# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.algebra.linear.vector.doubles.operation

## Class Projection

• java.lang.Object
• com.numericalmethod.suanshu.algebra.linear.vector.doubles.operation.Projection

• public class Projection
extends Object
Project a vector v on another vector w or a set of vectors (basis) {wi}.
Wikipedia: Vector projection
• ### Constructor Summary

Constructors
Constructor and Description
Projection(Vector v, List<Vector> basis)
Project a vector v onto a set of basis {wi}.
Projection(Vector v, Vector w)
Project a vector v onto another vector.
Projection(Vector v, Vector[] basis)
Project a vector v onto a set of basis {wi}.
• ### Method Summary

All Methods
Modifier and Type Method and Description
ImmutableVector getOrthogonalVector()
Get the orthogonal vector which is equal to v minus the projection of v on {wi}.
double getProjectionLength(int i)
Get the length of v projected on each dimension {wi}.
ImmutableVector getProjectionVector(int i)
Get the i-th projected vector of v on {wi}.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### Projection

public Projection(Vector v,
List<Vector> basis)
Project a vector v onto a set of basis {wi}.
Parameters:
v - a vector
basis - {wi}
• #### Projection

public Projection(Vector v,
Vector[] basis)
Project a vector v onto a set of basis {wi}.
Parameters:
v - a vector
basis - {wi}
• #### Projection

public Projection(Vector v,
Vector w)
Project a vector v onto another vector.
Parameters:
v - a vector
w - another vector
• ### Method Detail

• #### getOrthogonalVector

public ImmutableVector getOrthogonalVector()
Get the orthogonal vector which is equal to v minus the projection of v on {wi}.
Returns:
the orthogonal vector
• #### getProjectionLength

public double getProjectionLength(int i)
Get the length of v projected on each dimension {wi}.
Parameters:
i - an index, counting from 0
Returns:
the i-th projection length
• #### getProjectionVector

public ImmutableVector getProjectionVector(int i)
Get the i-th projected vector of v on {wi}. It lies on the hyperplane of {wi}.
Parameters:
i - an index, counting from 0
Returns:
the i-th projection vector