Line

Line shape.

Constructor

new Line(begin, end)

Parameters:
NameTypeDescription
beginPoint2D

A Point2D representing the beginning of the line.

endPoint2D

A Point2D representing the end of the line.

Classes

Line

Methods

equals(rhs) → {boolean}

Check for equality.

Parameters:
NameTypeDescription
rhsLine

The object to compare to.

Returns:

True if both objects are equal.

Type: 
boolean

getBegin() → {Point2D}

Get the begin point of the line.

Returns:

The beginning point of the line.

Type: 
Point2D

getCentroid() → {Point2D}

Get the centroid of the line.

Returns:

THe centroid point.

Type: 
Point2D

getDeltaX() → {number}

Get the line delta in the X direction.

Returns:

The delta in the X direction.

Type: 
number

getDeltaY() → {number}

Get the line delta in the Y direction.

Returns:

The delta in the Y direction.

Type: 
number

getEnd() → {Point2D}

Get the end point of the line.

Returns:

The ending point of the line.

Type: 
Point2D

getInclination() → {number}

Get the inclination of the line.

Returns:

The inclination of the line.

Type: 
number

getIntercept() → {number}

Get the intercept of the line.

Returns:

The slope of the line.

Type: 
number

getLength() → {number}

Get the length of the line.

Returns:

The length of the line.

Type: 
number

getMidpoint() → {Point2D}

Get the mid point of the line.

Returns:

The mid point of the line.

Type: 
Point2D

getSlope() → {number}

Get the slope of the line.

Returns:

The slope of the line.

Type: 
number

getWorldLength(spacing2D) → {number}

Get the length of the line according to a spacing.

Parameters:
NameTypeDescription
spacing2DScalar2D

The 2D spacing.

Returns:

The length of the line with spacing or null for null spacings.

Type: 
number

quantify(viewController) → {object}

Quantify a line according to view information.

Parameters:
NameTypeDescription
viewControllerViewController

The associated view controller.

Returns:

A quantification object.

Type: 
object