public final class Vector2Float
extends java.lang.Object
implements net.kyori.examination.Examinable, java.lang.Iterable<java.lang.Float>
| Modifier and Type | Field and Description |
|---|---|
static Vector2Float |
ONE
Constant for
Vector2Float value with
abscissa and ordinate of 1 one. |
static Vector2Float |
ZERO
Constant for
Vector2Float value with
abscissa and ordinate of 0 zero. |
| Constructor and Description |
|---|
Vector2Float(float x,
float y)
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull Vector2Float |
add(@NotNull Vector2Float value)
Returns a new
vector result of
adding the given value to this vector. |
@NotNull Vector2Float |
divide(float value)
Returns a new
vector result of
dividing this vector by the given scalar value. |
@NotNull Vector2Float |
divide(@NotNull Vector2Float value)
Returns a new
vector result of
dividing this vector by the given value vector. |
boolean |
equals(java.lang.Object o) |
@NotNull java.util.stream.Stream<? extends net.kyori.examination.ExaminableProperty> |
examinableProperties() |
int |
hashCode() |
@NotNull java.util.Iterator<java.lang.Float> |
iterator() |
@NotNull Vector2Float |
multiply(float value)
Returns a new
vector result of
multiplying this vector by the given scalar value. |
@NotNull Vector2Float |
multiply(@NotNull Vector2Float value)
Returns a new
vector result of
multiplying the given value vector by this vector. |
@NotNull Vector2Float |
subtract(@NotNull Vector2Float value)
Returns a new
vector result of
subtracting the given value to this vector. |
float[] |
toArray()
Converts this vector object to a
float array
with the X component at index 0 and the Y component
at index 1. |
java.lang.String |
toString() |
float |
x()
Returns the "X" component or abscissa
of this vector.
|
float |
y()
Returns the "Y" component or ordinate
of this vector.
|
public static final Vector2Float ZERO
Vector2Float value with
abscissa and ordinate of 0 zero.public static final Vector2Float ONE
Vector2Float value with
abscissa and ordinate of 1 one.public Vector2Float(float x,
float y)
x - The vector abscissay - The vector ordinatepublic float x()
public float y()
@Contract(value="_ -> new",
pure=true)
@NotNull
public @NotNull Vector2Float add(@NotNull
@NotNull Vector2Float value)
vector result of
adding the given value to this vector.value - The value to add@Contract(value="_ -> new",
pure=true)
@NotNull
public @NotNull Vector2Float subtract(@NotNull
@NotNull Vector2Float value)
vector result of
subtracting the given value to this vector.value - The value to subtract@Contract(value="_ -> new",
pure=true)
@NotNull
public @NotNull Vector2Float multiply(@NotNull
@NotNull Vector2Float value)
vector result of
multiplying the given value vector by this vector.
The resulting X component is calculated by multiplying the X components of both vectors.
The resulting Y component is calculated by multiplying the Y components of both vectors.
value - The value to multiply@Contract(value="_ -> new",
pure=true)
@NotNull
public @NotNull Vector2Float multiply(float value)
vector result of
multiplying this vector by the given scalar value.value - The factor@Contract(value="_ -> new",
pure=true)
@NotNull
public @NotNull Vector2Float divide(@NotNull
@NotNull Vector2Float value)
vector result of
dividing this vector by the given value vector.
The resulting X component is calculated by dividing the X components of both vectors.
The resulting Y component is calculated by dividing the Y components of both vectors.
value - The value to divide@Contract(value="_ -> new",
pure=true)
@NotNull
public @NotNull Vector2Float divide(float value)
vector result of
dividing this vector by the given scalar value.value - The divisor@Contract(value="-> new",
pure=true)
public float[] toArray()
float array
with the X component at index 0 and the Y component
at index 1.@NotNull public @NotNull java.util.Iterator<java.lang.Float> iterator()
iterator in interface java.lang.Iterable<java.lang.Float>@NotNull public @NotNull java.util.stream.Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()
examinableProperties in interface net.kyori.examination.Examinablepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object