[name]

A geometric line segment represented by a start and end point.

Constructor

[name]([page:Vector3 start], [page:Vector3 end])

start -- [page:Vector3] Start of the line segment
end -- [page:Vector3] End of the line segment
The start and end vectors default to origin vectors if none are set.

Properties

[property:Vector3 start]

[property:Vector3 end]

Methods

[method:Line3 set]([page:Vector3 start], [page:Vector3 end])

start -- [page:Vector3]
end -- [page:Vector3]
Sets the start and end values by copying the provided vectors.

[method:Line3 copy]([page:Line3 line])

line -- [page:Line3]
Copies the passed line's start and end vectors to this line.

[method:Line3 clone]()

Return a new copy of this [page:Line3].

[method:Boolean equals]([page:Line3 line])

line -- [page:Line3]

[method:Float distance]()

Returns the length of the line segment.
Returns true if both line's start and end points are equal.

[method:Float distanceSq]()

Returns the line segment's length squared.

[method:Line3 applyMatrix4]([page:Matrix4 matrix]) [page:Line3 this]

matrix -- [page:Matrix4]
Apply a matrix transform to the line segment.

[method:Vector at]([page:Float t], [page:Vector3 optionalTarget])

t -- [page:Float] Use values 0-1 to return a result on the line segment.
optionalTarget -- [page:Vector] Optional target to set the result.
Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector.

[method:Vector3 center]([page:Vector3 optionalTarget])

optionalTarget -- [page:Vector3] Optional target to set the result.
Return the center of the line segment.

[method:Vector3 delta]([page:Vector3 optionalTarget])

optionalTarget -- [page:Vector3] Optional target to set the result.
Returns the delta vector of the line segment, or the end vector minus the start vector.

[method:Vector3 closestPointToPoint]([page:Vector3 point], [page:Boolean clampToLine], [page:Vector3 optionalTarget])

point -- [page:Vector3]
clampToLine -- [page:Boolean]
optionalTarget -- [page:Vector3] Optional target to set the result.
Returns the closets point on the line. If clamp to line is true, then the returned value will be clamped to the line segment.

[method:Float closestPointToPointParameter]([page:Vector3 point], [page:Boolean clampToLine])

point -- [page:Vector3]
clampToLine -- [page:Boolean]
Returns a point parameter based on the closest point as projected on the line segement. If clamp to line is true, then the returned value will be between 0 and 1.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]