文档

Unity Engine

Unity Engine

IntersectLines(Vector2, Vector2, Vector2, Vector2)

Finds the intersection between two infinite lines
阅读时间1 分钟最后更新于 1 个月前

Definition

public static Vector2 IntersectLines(Vector2 line1Pt1, Vector2 line1Pt2, Vector2 line2Pt1, Vector2 line2Pt2)

Parameters

line1Pt1

The first point of the first line

line1Pt2

The second point of the first line

line2Pt1

The first point of the second line

line2Pt2

The second point of the second line

Returns

Type

Description

Vector2The intersection point, or (float.PositiveInfinity, float.PositiveInfinity) if the lines are parallel