- java.lang.Object
-
- swim.math.R2
-
- All Implemented Interfaces:
Debug
,AffineSpace<R2Point,R2Vector,Double>
,F2<R2Vector,Double>
,TensorSpace<R2Vector,Double>
,VectorModule<R2Vector,Double>
,VectorSpace<R2Vector,Double>
public class R2 extends Object implements AffineSpace<R2Point,R2Vector,Double>, VectorSpace<R2Vector,Double>, F2<R2Vector,Double>, Debug
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
R2()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description R2Vector
add(R2Vector u, R2Vector v)
R2Vector
combine(Double a, R2Vector u, Double b, R2Vector v)
<T> Output<T>
debug(Output<T> output)
Writes a developer readable, debug-formatted string representation of this object tooutput
.R2Vector
difference(R2Point p, R2Point q)
TensorDims
dimensions()
Double
getX(R2Vector v)
Double
getY(R2Vector v)
R2Vector
multiply(R2Vector u, Double a)
R2Vector
of(Double x, Double y)
R2Vector
opposite(R2Vector v)
R2Point
origin()
R
scalar()
static R2
space()
R2Vector
subtract(R2Vector u, R2Vector v)
String
toString()
R2Point
translate(R2Point p, R2Vector v)
R2
vector()
R2Vector
zero()
-
-
-
Method Detail
-
vector
public final R2 vector()
- Specified by:
vector
in interfaceAffineSpace<R2Point,R2Vector,Double>
-
scalar
public final R scalar()
- Specified by:
scalar
in interfaceAffineSpace<R2Point,R2Vector,Double>
- Specified by:
scalar
in interfaceTensorSpace<R2Vector,Double>
- Specified by:
scalar
in interfaceVectorModule<R2Vector,Double>
- Specified by:
scalar
in interfaceVectorSpace<R2Vector,Double>
-
dimensions
public TensorDims dimensions()
- Specified by:
dimensions
in interfaceTensorSpace<R2Vector,Double>
-
origin
public final R2Point origin()
- Specified by:
origin
in interfaceAffineSpace<R2Point,R2Vector,Double>
-
zero
public final R2Vector zero()
- Specified by:
zero
in interfaceTensorSpace<R2Vector,Double>
- Specified by:
zero
in interfaceVectorModule<R2Vector,Double>
- Specified by:
zero
in interfaceVectorSpace<R2Vector,Double>
-
add
public final R2Vector add(R2Vector u, R2Vector v)
- Specified by:
add
in interfaceTensorSpace<R2Vector,Double>
- Specified by:
add
in interfaceVectorModule<R2Vector,Double>
- Specified by:
add
in interfaceVectorSpace<R2Vector,Double>
-
opposite
public final R2Vector opposite(R2Vector v)
- Specified by:
opposite
in interfaceTensorSpace<R2Vector,Double>
- Specified by:
opposite
in interfaceVectorModule<R2Vector,Double>
- Specified by:
opposite
in interfaceVectorSpace<R2Vector,Double>
-
subtract
public final R2Vector subtract(R2Vector u, R2Vector v)
- Specified by:
subtract
in interfaceTensorSpace<R2Vector,Double>
- Specified by:
subtract
in interfaceVectorModule<R2Vector,Double>
- Specified by:
subtract
in interfaceVectorSpace<R2Vector,Double>
-
multiply
public final R2Vector multiply(R2Vector u, Double a)
- Specified by:
multiply
in interfaceTensorSpace<R2Vector,Double>
- Specified by:
multiply
in interfaceVectorModule<R2Vector,Double>
- Specified by:
multiply
in interfaceVectorSpace<R2Vector,Double>
-
combine
public final R2Vector combine(Double a, R2Vector u, Double b, R2Vector v)
- Specified by:
combine
in interfaceTensorSpace<R2Vector,Double>
- Specified by:
combine
in interfaceVectorModule<R2Vector,Double>
- Specified by:
combine
in interfaceVectorSpace<R2Vector,Double>
-
translate
public final R2Point translate(R2Point p, R2Vector v)
- Specified by:
translate
in interfaceAffineSpace<R2Point,R2Vector,Double>
-
difference
public final R2Vector difference(R2Point p, R2Point q)
- Specified by:
difference
in interfaceAffineSpace<R2Point,R2Vector,Double>
-
debug
public <T> Output<T> debug(Output<T> output)
Description copied from interface:Debug
Writes a developer readable, debug-formatted string representation of this object tooutput
.
-
space
public static R2 space()
-
-