Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IntersectLines(Vector2, Vector2, Vector2, Vector2)

Finds the intersection between two infinite lines
Read time 1 minuteLast updated 6 days ago

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