DOTS Geometry
 
Loading...
Searching...
No Matches
LineSegment2D Struct Reference

A simple struct representing a segment of a 2D Line. GPU: GGGShapes. More...

Public Member Functions

bool Equals (LineSegment2D other)
 
float2 GetCenter ()
 
override int GetHashCode ()
 
float Length ()
 
 LineSegment2D (Vector2 a, Vector2 b)
 
override string ToString ()
 

Static Public Member Functions

static float Distance (LineSegment2D ls, float2 point)
 
static bool PointIsToTheLeft (LineSegment2D ls, float2 point)
 Returns true, if the given point is to the left of the line given its direction.
 

Public Attributes

Vector2 a
 
Vector2 b
 

Static Public Attributes

static readonly LineSegment2D negativeInfinite = new LineSegment2D() { a = Vector2.negativeInfinity, b = Vector2.negativeInfinity }
 
static readonly LineSegment2D positiveInfinite = new LineSegment2D() { a = Vector2.positiveInfinity, b = Vector2.positiveInfinity }
 

Detailed Description

A simple struct representing a segment of a 2D Line. GPU: GGGShapes.

Member Function Documentation

◆ Distance()

static float Distance ( LineSegment2D ls,
float2 point )
static
Parameters
ls
point
Returns
The shortest (euclidean) distance between a 2D line segment and a 2D point

◆ PointIsToTheLeft()

static bool PointIsToTheLeft ( LineSegment2D ls,
float2 point )
static

Returns true, if the given point is to the left of the line given its direction.

Parameters
line
point
Returns