LineSegment2d
Public Class
Table of Contents
Signature
class LineSegment2d extends BaseSegment2d<LineSegment2dModel> {}
References
BaseSegment2d, LineSegment2dModel
Constructor
Public Constructor
Constructs a new instance of the LineSegment2d class
Parameters
| Name | Description | 
|---|---|
| 
 |  | 
| 
 |  | 
| 
 (optional) |  | 
References
Properties
a
Public Property
Signature
a: VecLike
References
angle
Public Readonly Property
Signature
get angle(): number
b
Public Property
Signature
b: VecLike
References
bounds
Public Readonly Property
Signature
get bounds(): Box2d
References
length
Public Readonly Property
Signature
get length(): number
tangent
Public Readonly Property
Signature
get tangent(): Vec2d
References
Methods
Angle()
Public Static Method
Parameters
| Name | Description | 
|---|---|
| 
 |  | 
Returns
number
References
getClosestPointTo()
Public Method
Get the closest point on the segment to an arbitrary point.
Parameters
| Name | Description | 
|---|---|
| 
 | The arbitrary point. | 
Returns
{
  point: Vec2d
  distance: number
}
References
getNormal()
Public Method
Parameters
None
Returns
Vec2d
References
getPath()
Public Method
Parameters
| Name | Description | 
|---|---|
| 
 (optional) |  | 
Returns
string
getPoint()
Public Method
Parameters
| Name | Description | 
|---|---|
| 
 |  | 
Returns
Vec2d
References
getX()
Public Method
Parameters
| Name | Description | 
|---|---|
| 
 |  | 
Returns
number
getY()
Public Method
Parameters
| Name | Description | 
|---|---|
| 
 |  | 
Returns
number
Length()
Public Static Method
Parameters
| Name | Description | 
|---|---|
| 
 |  | 
Returns
number
References
Tangent()
Public Static Method
Parameters
| Name | Description | 
|---|---|
| 
 |  | 
Returns
Vec2d