default
tkmath
tkmathtkmath.Vector2fadd(Vector2f v) - Add another vector v to this instance
add2f(float tx, ty) - Translate x / y components
addf(float v) - Add scalar value to all components
bilinearQuadPos() - Calc interpolated quad position from normalized (0..1) coordinates (0;0=left/top)
clamp(float l) - Clamp to length
cross(Vector2f v) : float - Returns the z component of the orthogonal vector of the cross product
distanceToPlane(Vector2f q, n) : float - Calc distance of vertex to plane defined by Vector2f q (on plane) and plane normal n
distanceToSphere(Vector2f p, float radius) : float - Calc distance of vertex to sphere defined by Vector2f p (sphere center) and sphere radius.
dot(Vector2f v) : float - Calculate dot product from this instance and v
getAbs() : float - Return length of vector
getAbsSqr() : float - Return squared length of vector
getAngle() : float - Returns angular direction (in radians) (0=north/0;1)
getString() : String - Get string representation (x, y) of vector
getX() : float - Get value of x element
getY() : float - Get value of y element
getYX() : float - Get yx vector
init(float x, y) - Initialize vector from scalars
initAngle() - Initializes vector from angle (in radians) (0=north/0;1)
initScalef(Vector2f v, float s) - Initialise values to s*v
intersect(Vector2f v, float s) - Returns intersection point in 'this'
isWithinSphere(Vector2f p, float radiusSquared) : boolean - Check if vertex is located within sphere defined by Vector2f p (sphere center) and squared sphere radius 'radiusSquared'.
lerp(Vector2f o) - Linear interpolate to another vector
mul(Vector2f v) - Multiply the x element of this instance by the x element of v and do the same with the y element
mul2f(float sx, sy) - Scale x / y components
mulf(float s) - Multiply this instance by scalar value s
New(float x, y) : Vector2f - Initialize and return new Vector2f instance
rotateCCW90() - Rotate 90 degrees counter-clock-wise (x = -y, y = x)
rotateCW90() - Rotate 90 degrees clock-wise (x = y, y = -x)
setX(float a) - Set x element to a
setY(float a) - Set y element to a
sub(Vector2f v) - Substract another vector v from this instance
tensor(Vector2f v) : Matrix2f - Create resulting matrix of tensor product from this instance and v
transform(Matrix m) - Multiply matrix by this vector.
unit() - Scale vector to length 1 if possible
unitScale(float s) - Set length to sMethod add | |||||
Add another vector v to this instance | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method add2f | |||||||||||||||
Translate x / y components | |||||||||||||||
Signature | |||||||||||||||
| |||||||||||||||
Arguments | |||||||||||||||
|
Method addf | |||||
Add scalar value to all components | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method bilinearQuadPos | |||
Calc interpolated quad position from normalized (0..1) coordinates (0;0=left/top) | |||
Signature | |||
|
Method clamp | |||||
Clamp to length | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method cross | ||||||||||
Returns the z component of the orthogonal vector of the cross product | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method distanceToPlane | |||
Calc distance of vertex to plane defined by Vector2f q (on plane) and plane normal n | |||
Signature | |||
Arguments | |||
Returns | |||
|
Method distanceToSphere | ||||||||||||||||||||
Calc distance of vertex to sphere defined by Vector2f p (sphere center) and sphere radius. | ||||||||||||||||||||
Signature | ||||||||||||||||||||
| ||||||||||||||||||||
Arguments | ||||||||||||||||||||
| ||||||||||||||||||||
Returns | ||||||||||||||||||||
| ||||||||||||||||||||
Method dot | ||||||||||
Calculate dot product from this instance and v | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
| ||||||||||
Method getAbs | |||||
Return length of vector | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getAbsSqr | |||||
Return squared length of vector | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getAngle | |||||
Returns angular direction (in radians) (0=north/0;1) | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getString | |||||
Get string representation (x, y) of vector | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getX | |||||
Get value of x element | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getY | |||||
Get value of y element | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getYX | |||||
Get yx vector | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method init | |||||||||||||||
Initialize vector from scalars | |||||||||||||||
Signature | |||||||||||||||
| |||||||||||||||
Arguments | |||||||||||||||
|
Method initAngle | |||
Initializes vector from angle (in radians) (0=north/0;1) | |||
Signature | |||
|
Method initScalef | |||||||||||||||
Initialise values to s*v | |||||||||||||||
Signature | |||||||||||||||
| |||||||||||||||
Arguments | |||||||||||||||
|
Method intersect | |||||||||||||||
Returns intersection point in 'this' | |||||||||||||||
Signature | |||||||||||||||
| |||||||||||||||
Arguments | |||||||||||||||
| |||||||||||||||
Description | |||||||||||||||
Returns normalized position on edge v2s<>v2e. |
Method isWithinSphere | ||||||||||||||||||||
Check if vertex is located within sphere defined by Vector2f p (sphere center) and squared sphere radius 'radiusSquared'. | ||||||||||||||||||||
Signature | ||||||||||||||||||||
| ||||||||||||||||||||
Arguments | ||||||||||||||||||||
| ||||||||||||||||||||
Returns | ||||||||||||||||||||
| ||||||||||||||||||||
Method lerp | |||||
Linear interpolate to another vector | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method mul | |||||
Multiply the x element of this instance by the x element of v and do the same with the y element | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method mul2f | |||||||||||||||
Scale x / y components | |||||||||||||||
Signature | |||||||||||||||
| |||||||||||||||
Arguments | |||||||||||||||
|
Method mulf | |||||
Multiply this instance by scalar value s | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method New | ||||||||||||||||||||
Initialize and return new Vector2f instance | ||||||||||||||||||||
Signature | ||||||||||||||||||||
| ||||||||||||||||||||
Arguments | ||||||||||||||||||||
| ||||||||||||||||||||
Returns | ||||||||||||||||||||
| ||||||||||||||||||||
Method rotateCCW90 | |||
Rotate 90 degrees counter-clock-wise (x = -y, y = x) | |||
Signature | |||
|
Method rotateCW90 | |||
Rotate 90 degrees clock-wise (x = y, y = -x) | |||
Signature | |||
|
Method setX | |||||
Set x element to a | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method setY | |||||
Set y element to a | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method sub | |||||
Substract another vector v from this instance | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method tensor | ||||
Create resulting matrix of tensor product from this instance and v | ||||
Signature | ||||
Arguments | ||||
| ||||
Returns | ||||
|
Method transform | |||||
Multiply matrix by this vector. | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method unit | |||
Scale vector to length 1 if possible | |||
Signature | |||
|
Method unitScale | |||||
Set length to s | |||||
Signature | |||||
| |||||
Arguments | |||||
|
auto-generated by "DOG", the TkScript document generator. Thu, 11/Dec/2025 13:42:00