Class Vector1D.Sum
java.lang.Object
org.apache.commons.geometry.euclidean.EuclideanVectorSum<Vector1D>
org.apache.commons.geometry.euclidean.oned.Vector1D.Sum
- Enclosing class:
Vector1D
Class used to create high-accuracy sums of vectors. Each vector component is
summed using an instance of
Sum.
This class is mutable and not thread-safe.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdd a vector to this instance.Add a scaled vector to this instance.static Vector1D.Sumcreate()Create a new instance with an initial value set to thezero vector.get()static Vector1D.SumConstruct a new instance with an initial value set to the argument.static Vector1D.SumConstruct a new instance from multiple values.Methods inherited from class EuclideanVectorSum
accept
-
Method Details
-
add
Add a vector to this instance.- Specified by:
addin classEuclideanVectorSum<Vector1D>- Parameters:
vec- vector to add- Returns:
- this instance
-
addScaled
Add a scaled vector to this instance. In general, the result produced by this method will be more accurate than if the vector was scaled first and then added directly. In other words,sum.addScale(scale, vec)will generally produce a better result thansum.add(vec.multiply(scale)).- Specified by:
addScaledin classEuclideanVectorSum<Vector1D>- Parameters:
scale- scale factorvec- vector to scale and add- Returns:
- this instance
-
get
-
create
Create a new instance with an initial value set to thezero vector.- Returns:
- new instance set to zero
-
of
Construct a new instance with an initial value set to the argument.- Parameters:
initial- initial sum value- Returns:
- new instance
-
of
Construct a new instance from multiple values.- Parameters:
first- first vectormore- additional vectors- Returns:
- new instance
-