上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 40 下一页
摘要: 同侧法 点p在三角形三条边的同侧时,点p在三角形内。可以通过叉乘结果是否都为正或负来判断是否同侧 1) 三角形顶点逆时针时 1-a) ab与ap, bc与bp, ca与cp的夹角均为右手逆时针锐角,sin(锐角)>0,即:叉乘结果>0,此时p在三角形内。 1-b) bc与bp的夹角为0度,sin(0 阅读全文
posted @ 2023-11-04 01:04 yanghui01 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 1) 如果点在以线段ab为对角线的矩形外, 肯定不在线段上 2) 点p和线段端点a或b重叠时, 在线段上 3) ap和ab的夹角为0度,则点在线段上; 否则不在线段上 叉乘判断 //点是否在线段上 public static bool IsPointOnSegment(Vector2 p, Vect 阅读全文
posted @ 2023-11-04 00:04 yanghui01 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 一个点在圆内 两个点都在圆内 两个点都在圆外 public static bool IsSegmentCircleIntersect(Vector2 p1, Vector2 p2, Vector2 center, float r) { float sqrR = r * r; //1) 一个点在圆内, 阅读全文
posted @ 2023-11-03 00:21 yanghui01 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 更推荐这个:点到线段的最近距离, 点与线段的位置关系 - 投影方式 判断依据 点与线段端点组成的三角形,有一个角是钝角或180度时,点在线段外侧 sin(锐角)>0, sin(钝角)>0,无法区分,所以叉乘不行。 cos(锐角)>0, cos(钝角)<0,可以区分,所以用点乘。 1) 在外侧时 a) 阅读全文
posted @ 2023-11-03 00:08 yanghui01 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 注意:这边的矩形不带旋转 两圆是否相交 //两圆是否相交 public static bool IsTwoCircleIntersect(Vector2 center1, float r1, Vector2 center2, float r2) { var r = r1 + r2; var resu 阅读全文
posted @ 2023-11-02 23:31 yanghui01 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 点是否在矩形内 //点是否在矩形内 public static bool IsPointInRect(Vector2 p, Vector2 min, Vector2 max) { if (p.x < min.x || p.x > max.x) return false; if (p.y < min. 阅读全文
posted @ 2023-11-02 23:04 yanghui01 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 把p点的x值代入直线方程算出y,如果和p点的y值相同则在直线上 public static bool IsPointOnLine(Vector2 p, float k, float t) { //y=kx+t float y = k * p.x + t; return Mathf.Approxima 阅读全文
posted @ 2023-11-01 22:53 yanghui01 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 直线的表示方法 点斜式:y=kx+t, 其中k为直线斜率, t为直线在y轴上的截距 一般式:ax+by+c=0 求直线方程 1) 已知直线上的两个点(x1, y1), (x2, y2),求直线ax+by+c=0 a) 我们先转换成点斜式: b) 斜率可以根据已知的两点计算出来 ,所以a=y2-y1, 阅读全文
posted @ 2023-11-01 22:49 yanghui01 阅读(127) 评论(0) 推荐(0) 编辑
摘要: GeoGebra - 风靡世界, 过亿师生沉迷使用的免费数学软件, 函数图像, 几何画板, 3d计算器等 www.desmos.com, 函数图像, 几何, 矩阵, 3d工具等 Symbolab 数学求解器 - 分步计算器, 函数图像, 几何, 数学计算器, 解体步骤等 MathTool公式编辑器 阅读全文
posted @ 2023-11-01 21:48 yanghui01 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 效果 多边形表示 //#define X_ROTATE_90 using System; using System.Collections.Generic; using UnityEngine; public class MyPolygon : MonoBehaviour { [SerializeF 阅读全文
posted @ 2023-10-31 23:41 yanghui01 阅读(18) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 40 下一页