dwv.math. Line

new Line(begin, end)

Line shape.

Parameters:
NameTypeDescription
begindwv.math.Point2D

A Point2D representing the beginning of the line.

enddwv.math.Point2D

A Point2D representing the end of the line.

Methods

equals(rhs) → {boolean}

Check for equality.

Parameters:
NameTypeDescription
rhsdwv.math.Line

The object to compare to.

Returns:

True if both objects are equal.

Type: 
boolean

getBegin() → {dwv.math.Point2D}

Get the begin point of the line.

Returns:

The beginning point of the line.

Type: 
dwv.math.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() → {dwv.math.Point2D}

Get the end point of the line.

Returns:

The ending point of the line.

Type: 
dwv.math.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() → {dwv.math.Point2D}

Get the mid point of the line.

Returns:

The mid point of the line.

Type: 
dwv.math.Point2D

getSlope() → {number}

Get the slope of the line.

Returns:

The slope of the line.

Type: 
number

getWorldLength(spacingX, spacingY) → {number}

Get the length of the line according to a spacing.

Parameters:
NameTypeDescription
spacingXnumber

The X spacing.

spacingYnumber

The Y 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
viewControllerobject

The associated view controller.

Returns:

A quantification object.

Type: 
object