public static final class Vector2D.Sum extends EuclideanVectorSum<Vector2D>
Sum
.
This class is mutable and not thread-safe.
Sum
Modifier and Type | Method and Description |
---|---|
Vector2D.Sum |
add(Vector2D vec)
Add a vector to this instance.
|
Vector2D.Sum |
addScaled(double scale,
Vector2D vec)
Add a scaled vector to this instance.
|
static Vector2D.Sum |
create()
Create a new instance with an initial value set to the
zero vector . |
Vector2D |
get() |
static Vector2D.Sum |
of(Vector2D initial)
Construct a new instance with an initial value set to the argument.
|
static Vector2D.Sum |
of(Vector2D first,
Vector2D... more)
Construct a new instance from multiple values.
|
accept
public Vector2D.Sum add(Vector2D vec)
add
in class EuclideanVectorSum<Vector2D>
vec
- vector to addpublic Vector2D.Sum addScaled(double scale, Vector2D vec)
sum.addScale(scale, vec)
will generally produce a better result than
sum.add(vec.multiply(scale))
.addScaled
in class EuclideanVectorSum<Vector2D>
scale
- scale factorvec
- vector to scale and addpublic static Vector2D.Sum create()
zero vector
.public static Vector2D.Sum of(Vector2D initial)
initial
- initial sum valuepublic static Vector2D.Sum of(Vector2D first, Vector2D... more)
first
- first vectormore
- additional vectorsCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.