Package org.graphstream.ui.geom
Class Vector3
java.lang.Object
org.graphstream.ui.geom.Vector2
org.graphstream.ui.geom.Vector3
- All Implemented Interfaces:
Serializable
public class Vector3 extends Vector2
A three component vector made of doubles.
- Since:
- 20000613
- Version:
- 0.1
- Author:
- Antoine Dutot
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidadd(Vector3 other)Add each element of other to the corresponding element of this.Objectclone()voidcopy(Point3 point)Make this a copy ofpoint.voidcopy(Vector3 other)Make this a copy of other.voidcrossProduct(Vector3 other)Set this to the cross product of this and other.voidcrossProduct(Vector3 A, Vector3 B)Set this to the cross product of A and B.doubledotProduct(double ox, double oy, double oz)doubledotProduct(Vector3 other)Dot product of this and other.booleanequals(Object other)Is this equal to other ?voidfill(double value)Assign value to all elements.booleanisZero()Are all components to zero?.doublelength()Cartesian length.voidmult(Vector3 other)Multiply each element of this by the corresponding element of other.doublenormalize()Transform this into an unit vector.voidscalarAdd(double value)Add value to each element.voidscalarDiv(double value)Divide each element by value.voidscalarMult(double value)Multiply each element by value.voidscalarSub(double value)Substract value to each element.voidset(double x, double y, double z)Explicitly set the three components.voidset(int i, double value)Explicitly set the i-th component to value.voidsub(Vector3 other)Substract each element of other to the corresponding element of this.StringtoString()booleanvalidComponent(int i)Is i the index of a component ?doublez()
-
Constructor Details
-
Method Details
-
isZero
public boolean isZero()Are all components to zero?. -
equals
Is this equal to other ? -
validComponent
public boolean validComponent(int i)Is i the index of a component ? In other words, is i >= 0 && < than #count() ?- Overrides:
validComponentin classVector2
-
clone
-
dotProduct
public double dotProduct(double ox, double oy, double oz) -
dotProduct
Dot product of this and other. -
length
public double length()Cartesian length. -
z
public double z() -
fill
public void fill(double value)Assign value to all elements. -
set
public void set(int i, double value)Explicitly set the i-th component to value. -
set
public void set(double x, double y, double z)Explicitly set the three components. -
add
Add each element of other to the corresponding element of this. -
sub
Substract each element of other to the corresponding element of this. -
mult
Multiply each element of this by the corresponding element of other. -
scalarAdd
public void scalarAdd(double value)Add value to each element. -
scalarSub
public void scalarSub(double value)Substract value to each element. -
scalarMult
public void scalarMult(double value)Multiply each element by value.- Overrides:
scalarMultin classVector2
-
scalarDiv
public void scalarDiv(double value)Divide each element by value. -
crossProduct
Set this to the cross product of this and other. -
crossProduct
Set this to the cross product of A and B. -
normalize
public double normalize()Transform this into an unit vector. -
copy
Make this a copy of other. -
copy
Make this a copy ofpoint. -
toString
-