Add v
to this vector and store the result in dest
.
double
double
Return the angle between this vector and the supplied vector.
double
double
Return the distance between this and v
.
double
double
Return the distance squared between this and v
.
Divide this by v
component-wise and store the result into dest
.
double
double
Return the dot product of this vector and v
.
boolean
boolean
Compare the vector components of this
vector with the given vector using the given delta
and return whether all of them are equal within a maximum difference of delta
.
static int
Determine the closest point on the triangle with the vertices v0
, v1
, v2
between that triangle and the given point p
and store that point into the given result
.
Add the component-wise multiplication of a * b
to this vector.
Add the component-wise multiplication of a * b
to this vector.
Add the component-wise multiplication of a * b
to this vector
and store the result in dest
.
Add the component-wise multiplication of a * b
to this vector
and store the result in dest
.
static boolean
Test whether the one circle with center centerA
and square radius radiusSquaredA
intersects the other
circle with center centerB
and square radius radiusSquaredB
, and store the center of the line segment of
intersection in the (x, y)
components of the supplied vector and the half-length of that line segment in the z component.
static int
Determine whether the undirected line segment with the end points p0
and p1
intersects the axis-aligned rectangle given as its minimum corner min
and maximum corner max
,
and store the values of the parameter t in the ray equation p(t) = p0 + t * (p1 - p0) of the near and far point of intersection
into result
.
static int
Determine whether the polygon specified by the given sequence of vertices
intersects with the ray
with given origin (originX, originY, originZ)
and direction (dirX, dirY, dirZ)
, and store the point of intersection
into the given vector p
.
static int
Determine whether the given ray with the given origin
and direction dir
intersects the axis-aligned rectangle given as its minimum corner min
and maximum corner max
,
and return the values of the parameter t in the ray equation p(t) = origin + t * dir of the near and far point of intersection
as well as the side of the axis-aligned rectangle the ray intersects.
static boolean
Test whether the ray with the given origin
and direction dir
intersects the circle with the given center
and square radius radiusSquared
,
and store the values of the parameter t in the ray equation p(t) = origin + t * dir for both points (near
and far) of intersections into the given result
vector.
static double
Test whether the ray with given origin
and direction dir
intersects the line
containing the given point
and having the given normal
, and return the
value of the parameter t in the ray equation p(t) = origin + t * dir of the intersection point.
static double
Determine whether the ray with given origin
and direction dir
intersects the undirected line segment
given by the two end points a
and b
, and return the value of the parameter t in the ray equation
p(t) = origin + t * dir of the intersection point, if any.
Linearly interpolate this
and other
using the given interpolation factor t
and store the result in this
.
Linearly interpolate this
and other
using the given interpolation factor t
and store the result in dest
.
Set the components of this vector to be the component-wise maximum of this and the other vector.
Set the components of dest
to be the component-wise maximum of this and the other vector.
Set the components of this vector to be the component-wise minimum of this and the other vector.
Set the components of dest
to be the component-wise minimum of this and the other vector.
Multiply this Vector2d component-wise by another Vector2d.
Multiply this Vector2d component-wise by another Vector2d and store the result in dest
.
Apply a rotation transformation to this matrix that rotates the given normalized fromDir
direction vector
to point along the normalized toDir
.
Apply a rotation transformation to this matrix that rotates the given normalized fromDir
direction vector
to point along the normalized toDir
, and store the result in dest
.
Apply a rotation transformation to this matrix that rotates the given normalized fromDir
direction vector
to point along the normalized toDir
, and store the result in dest
.
Apply scaling to this matrix by scaling the base axes by the given xy.x
and
xy.y
factors, respectively.
Apply scaling to this
matrix by scaling the base axes by the given xy.x
and
xy.y
factors, respectively and store the result in dest
.
Apply scaling to this matrix by scaling the base axes by the given xy
factors.
Apply scaling to this matrix by scaling the base axes by the given xy
factors
and store the result in dest
.
Apply scaling to this matrix by scaling the base axes by the given xy
factors
and store the result in dest
.
Set this matrix to be a simple scale matrix which scales the base axes by xy.x
and xy.y
respectively.
Set the two columns of this matrix to the supplied vectors, respectively.
Set the first two components from the given v
and the z component from the given z
Set the first two components from the given v
and the z component from the given z
Set the x and y components from the given v
and the z and w components to the given z
and w
.
Set the column at the given column
index, starting with 0
.
Set the row at the given row
index, starting with 0
.
Set only the translation components of this matrix (m20, m21)
to the given values (offset.x, offset.y)
.
Subtract v
from this vector.
Subtract v
from this
vector and store the result in dest
.
static boolean
Test whether the axis-aligned rectangle with minimum corner minA
and maximum corner maxA
intersects the axis-aligned rectangle with minimum corner minB
and maximum corner maxB
.
static boolean
Test whether the axis-aligned rectangle with minimum corner min
and maximum corner max
intersects the circle with the given center
and square radius radiusSquared
.
static boolean
Test whether the axis-aligned rectangle with minimum corner min
and maximum corner max
intersects the line with the general equation a*x + b*y + c = 0.
static boolean
Test whether the one circle with center centerA
and square radius radiusSquaredA
intersects the other
circle with center centerB
and square radius radiusSquaredB
.
static boolean
Test whether the circle with given center
and square radius radiusSquared
intersects the triangle with counter-clockwise vertices
v0
, v1
, v2
.
static boolean
Test whether the given point
lies inside the triangle with the vertices v0
, v1
, v2
.
static boolean
Test whether the ray with the given origin
and direction dir
intersects the given axis-aligned rectangle specified as its minimum corner min
and maximum corner max
.
static boolean
Test whether the ray with the given origin
and direction dir
intersects the circle with the given center
and square radius.
Transform the given vector by this matrix and store the result in dest
.
Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=0, by
this matrix and store the result in dest
.
Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=0, by
this matrix and store the result in dest
.
Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=1, by
this matrix and store the result in dest
.
Transform/multiply the given 2D-vector, as if it was a 3D-vector with z=1, by
this matrix and store the result in dest
.
Transform the given vector by the transpose of this matrix and store the result in dest
.
Apply a translation to this matrix by translating by the given number of units in x and y.
Apply a translation to this matrix by translating by the given number of units in x and y, and
store the result in dest
.
Apply a translation to this matrix by translating by the given number of units in x and y, and
store the result in dest
.
Pre-multiply a translation to this matrix by translating by the given number of
units in x and y.
Pre-multiply a translation to this matrix by translating by the given number of
units in x and y and store the result in dest
.
Pre-multiply a translation to this matrix by translating by the given number of
units in x and y and store the result in dest
.
Set this matrix to be a simple translation matrix in a two-dimensional coordinate system.
Unproject the given window coordinates winCoords
by this
matrix using the specified viewport
and compute the origin and the direction of the resulting ray which starts at NDC z = -1.0
and goes through NDC z = +1.0
.
Unproject the given 2D window coordinates winCoords
by this
matrix using the specified viewport
and compute the origin and the direction of the resulting ray which starts at NDC z = -1.0
and goes through NDC z = +1.0
.