乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 36|回复: 2

求教:简单的求两直线交点的代码

[复制链接]

4

主题

10

帖子

1

银币

初来乍到

Rank: 1

铜币
26
发表于 2004-10-15 10:07:00 | 显示全部楼层 |阅读模式
请大家指教,我想要两条直线的交点,请问有这样的命令吗?或者有简单些的代码吗?
回复

使用道具 举报

16

主题

909

帖子

8

银币

中流砥柱

Rank: 25

铜币
973
发表于 2004-10-15 10:18:00 | 显示全部楼层
Finds the intersection of two lines
(inters pt1 pt2 pt3 pt4 [onseg])
All points are expressed in terms of the current UCS. If all four point arguments are 3D, inters checks for 3D intersection. If any of the points are 2D, inters projects the lines onto the current construction plane and checks only for 2D intersection.
Arguments
pt1
One endpoint of the first line.
pt2
The other endpoint of the first line.
pt3
One endpoint of the second line.
pt4
The other endpoint of the second line.
onseg
If specified as nil, the lines defined by the four pt arguments are considered infinite in length. If the onseg argument is omitted or is not nil, the intersection point must lie on both lines or inters returns nil.
Return Values
If the onseg argument is present and is nil, inters returns the point where the lines intersect, even if that point is off the end of one or both of the lines. If the onseg argument is omitted or is not nil, the intersection point must lie on both lines or inters returns nil. The inters function returns nil if the two lines do not intersect.
Examples (setq a '(1.0 1.0) b '(9.0 9.0)) (setq c '(4.0 1.0) d '(4.0 2.0))
Command: (inters a b c d)
nil
Command: (inters a b c d T)
nil
Command: (inters a b c d nil)
(4.0 4.0)
回复

使用道具 举报

4

主题

10

帖子

1

银币

初来乍到

Rank: 1

铜币
26
发表于 2004-10-15 15:01:00 | 显示全部楼层
好长呀,嘿嘿,谢谢拉
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-8-20 15:33 , Processed in 1.267599 second(s), 59 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表