VertTuple
VertTuple
Readonly
classRequired to generate proper CSS classes and other class related IDs.
isDestroyed
VertTuple
Readonly
uidThe UID of this drawable object.
VertTuple
Static
utilsGenerate a four-point arrow head, starting at the vector end minus the arrow head length.
The first vertex in the returned array is guaranteed to be the located at the vector line end minus the arrow head length.
Due to performance all params are required.
The params scaleX and scaleY are required for the case that the scaling is not uniform (x and y scaling different). Arrow heads should not look distored on non-uniform scaling.
If unsure use 1.0 for scaleX and scaleY (=no distortion). For headlen use 8, it's a good arrow head size.
Example: buildArrowHead( new Vertex(0,0), new Vertex(50,100), 8, 1.0, 1.0 )
The start vertex of the vector to calculate the arrow head for.
The end vertex of the vector.
The length of the arrow head (along the vector direction. A good value is 12).
The horizontal scaling during draw.
the vertical scaling during draw.
Static
Private
vtutilsGet the angle between this and the passed line (in radians).
Optional
line: VertTuple<any>(optional) The line to calculate the angle to. If null the baseline (x-axis) will be used.
this
angle
VertTuple
Get the closest position T from this line to the specified point.
The counterpart for this function is Line.vertAt(Number).
The point (vertex) to measure the distance to.
The line position t of minimal distance to p.
getClosetT
getClosestT
VertTuple
Check if the given point is located on this line. Optionally also check if
that point is located between point a
and b
.
The point to check.
Optional
insideBoundsOnly: boolean[optional] If set to to true (default=false) the point must be between start and end point of the line.
Optional
epsilon: number[optional] A tolerance.
True if the given point is on this line.
hasPoint
VertTuple
The the minimal distance between this line and the specified point.
The point (vertex) to measre the distance to.
The absolute minimal distance.
pointDistance
VertTuple
Classdesc
A vector (Vertex,Vertex) is a line with a visible direction.
Vectors are drawn with an arrow at their end point.
The Vector class extends the Line class.
Requires
VertTuple
Requires
Vertex