Generated by DocFX

Struct Line

Line segment between two points

Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Ladybug
Assembly: ladybug.dll
Syntax
public struct Line

Constructors

| Improve this Doc View Source

Line(Vector2, Vector2)

Create a Line segment

Declaration
public Line(Vector2 p, Vector2 q)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 p

Start point of the Line

Microsoft.Xna.Framework.Vector2 q

End point of the Line

Properties

| Improve this Doc View Source

P

Start point of the line

Declaration
public Vector2 P { readonly get; }
Property Value
Type Description
Microsoft.Xna.Framework.Vector2
| Improve this Doc View Source

Q

End point of the line

Declaration
public Vector2 Q { readonly get; }
Property Value
Type Description
Microsoft.Xna.Framework.Vector2

Methods

| Improve this Doc View Source

Contains(Vector2)

Returns true if point v lies on the line

Declaration
public bool Contains(Vector2 v)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 v

Point to check

Returns
Type Description
System.Boolean
| Improve this Doc View Source

Contains(Vector2, Vector2, Vector2)

Returns true if point v lies on line segment pq

Declaration
public static bool Contains(Vector2 v, Vector2 p, Vector2 q)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 v

Point to check

Microsoft.Xna.Framework.Vector2 p

Start of line segment qr

Microsoft.Xna.Framework.Vector2 q

End of line segment qr

Returns
Type Description
System.Boolean
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.ValueType.GetHashCode()
| Improve this Doc View Source

GetSectionOrientation(Vector2, Vector2, Vector2)

Utility method. Finds orientation of ordered triplet of vectors.

Declaration
public static int GetSectionOrientation(Vector2 p, Vector2 q, Vector2 r)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 p
Microsoft.Xna.Framework.Vector2 q
Microsoft.Xna.Framework.Vector2 r
Returns
Type Description
System.Int32

0 if points are colinear. 1 if clockwise. 2 if counterclockwise

Remarks

Used in segment intersection detection

| Improve this Doc View Source

Intersects(Line)

Returns true if this line intersects with line l

Declaration
public bool Intersects(Line l)
Parameters
Type Name Description
Line l
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Intersects(Line, Line)

Returns true if lines l1 and l2 intersect

Declaration
public static bool Intersects(Line l1, Line l2)
Parameters
Type Name Description
Line l1
Line l2
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Intersects(Vector2, Vector2)

Returns true if this line intersects with line pq

Declaration
public bool Intersects(Vector2 p, Vector2 q)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 p
Microsoft.Xna.Framework.Vector2 q
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Intersects(Vector2, Vector2, Vector2, Vector2)

Returns true of lines p1q1 and p2q2 intersect

Declaration
public static bool Intersects(Vector2 p1, Vector2 q1, Vector2 p2, Vector2 q2)
Parameters
Type Name Description
Microsoft.Xna.Framework.Vector2 p1
Microsoft.Xna.Framework.Vector2 q1
Microsoft.Xna.Framework.Vector2 p2
Microsoft.Xna.Framework.Vector2 q2
Returns
Type Description
System.Boolean