public class Vector2f extends Tuple2f implements Serializable
Constructor and Description |
---|
Vector2f()
Constructs and initializes a Vector2f to (0,0).
|
Vector2f(float[] v)
Constructs and initializes a Vector2f from the specified array.
|
Vector2f(float x,
float y)
Constructs and initializes a Vector2f from the specified xy coordinates.
|
Vector2f(Tuple2d t1)
Constructs and initializes a Vector2f from the specified Tuple2d.
|
Vector2f(Tuple2f t1)
Constructs and initializes a Vector2f from the specified Tuple2f.
|
Vector2f(Vector2d v1)
Constructs and initializes a Vector2f from the specified Vector2d.
|
Vector2f(Vector2f v1)
Constructs and initializes a Vector2f from the specified Vector2f.
|
Modifier and Type | Method and Description |
---|---|
float |
angle(Vector2f v1)
Returns the angle in radians between this vector and the vector
parameter; the return value is constrained to the range [0,PI].
|
float |
dot(Vector2f v1)
Computes the dot product of the this vector and vector v1.
|
float |
length()
Returns the length of this vector.
|
float |
lengthSquared()
Returns the squared length of this vector.
|
void |
normalize()
Normalizes this vector in place.
|
void |
normalize(Vector2f v1)
Sets the value of this vector to the normalization of vector v1.
|
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, getX, getY, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, setX, setY, sub, sub, toString
public Vector2f(float x, float y)
x
- the x coordinatey
- the y coordinatepublic Vector2f(float[] v)
v
- the array of length 2 containing xy in orderpublic Vector2f(Vector2f v1)
v1
- the Vector2f containing the initialization x y datapublic Vector2f(Vector2d v1)
v1
- the Vector2d containing the initialization x y datapublic Vector2f(Tuple2f t1)
t1
- the Tuple2f containing the initialization x y datapublic Vector2f(Tuple2d t1)
t1
- the Tuple2d containing the initialization x y datapublic Vector2f()
public final float dot(Vector2f v1)
v1
- the other vectorpublic final float length()
public final float lengthSquared()
public final void normalize(Vector2f v1)
v1
- the un-normalized vectorpublic final void normalize()
public final float angle(Vector2f v1)
v1
- the other vectorCopyright © 2016–2022 SciJava. All rights reserved.