只需一步,快速开始
各位前辈 已知一个点pt1的座标为(0 0 0),下一个点pt2的x位移量dst_x为100,下一个点的y位移量dst_y为30,有没有什么函数直接用这些已知条件求出下一个点pt2的座标?请大家给指点指点好吗?先谢谢了!
;;这是我个人的解法:(setq ptx (+ (car pt1) dst_x))(setq pty (+ (cadr pt1) dst_y))(setq pt2 (list ptx pty 0))
使用道具 举报
(setq x 100 y 30 )
(setq pt2(mapcar '+ (list x y 0) pt1))或(setq pt2(mapcar '(lambda (a b) (+ a b)) (list x y 0) pt1 ))
如果用变量改成第二种形式来求解。
谢谢ljpnb大侠,(setq pt2(mapcar '+ (list x y 0) pt1))很好用!I like it very munch!
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 ) ©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途
GMT+8, 2025-8-8 04:54 , Processed in 0.199760 second(s), 25 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.