package jndcliffford

jndclifford
Class NDElement

java.lang.Object
  extended by jndclifford.NDElement

public class NDElement
extends java.lang.Object

This class represents a geometric element in n-dimensional space.

Version:

0.2

Author:

Realized by Giorgio Vassallo, Pietro Brignola, May 2003.


Field Summary
private  javax.vecmath.Color3f color
          Clifford multivector's color.
private  java.util.ArrayList generators
          Generator's array list.
private  jclifford.CliffordBitSet multiVector
          Clifford multivector in (n+1)-dimensional homogeneous space.
 
Constructor Summary
NDElement()
          Creates and returns a new empty element.
NDElement(double[] point, javax.vecmath.Color3f color)
          Creates and returns a new element representing a point in n-dimensional space.
NDElement(double[] point1, double[] point2, javax.vecmath.Color3f color)
          Creates and returns a new element representing a segment from 2 points in n-dimensional space.
NDElement(double[] point1, double[] point2, double[] point3, javax.vecmath.Color3f color)
          Creates and returns a new element representing a triangle from 3 points in n-dimensional space.
 
Method Summary
 void addGenerator(double[] point)
          Add a specified generator to generator's arraylist.
 java.lang.Object clone()
          Creates and returns a Clifford element deeply cloning this Clifford element.
private static jclifford.CliffordBitSet createMultiVector(java.util.ArrayList generators)
          Computes Clifford homogeneous multiVector from the wedge product of all generators.
 javax.vecmath.Color3f getColor()
          Gets Clifford multivector's color.
 java.util.ArrayList getGenerators()
          Get generator's arraylist.
 int getGeneratorsSize()
          Get generator's arraylist size.
 jclifford.CliffordBitSet getMultiVector()
          Get Clifford multivector representing this NDElement.
static jclifford.CliffordBitSet getRotor(double[] v1, double[] v2, double angle)
          Creates and returns a Clifford rotor in the specified plane of a specified angle.
private  jclifford.CliffordBitSet getSmallestCommonSubspace(NDElement el)
          Computes smallest common subspace with the specified NDElement.
 jclifford.CliffordBitSet intersect(NDElement el)
          Computes the common intersection subspace of this element and the specified element.
 NDElement project(double[] f, double[] p1, double[] p2, double[] p3)
          Projects this element from the specified focus in the specified plane.
 NDElement rotate(double[] v1, double[] v2, double angle)
          Rotates this element in the specified plane.
 void setColor(javax.vecmath.Color3f color)
          Set Clifford multivector's color.
static jclifford.CliffordBitSet toHomoVector(double[] point)
          Creates a point in (n+1)-dimensional homogeneous space setting the homogeneous dimension.
 java.lang.String toString()
          Returns a string representation of this Object.
 NDElement translate(double[] v)
          Tralslates this element by the specified vector.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

multiVector

private jclifford.CliffordBitSet multiVector
Clifford multivector in (n+1)-dimensional homogeneous space.


generators

private java.util.ArrayList generators
Generator's array list.


color

private javax.vecmath.Color3f color
Clifford multivector's color.

Constructor Detail

NDElement

public NDElement()
Creates and returns a new empty element.


NDElement

public NDElement(double[] point,
                 javax.vecmath.Color3f color)
Creates and returns a new element representing a point in n-dimensional space.

Parameters:
point - the point in n-dimensional Euclidean space.
color - the color of the element (null color is white by default).

NDElement

public NDElement(double[] point1,
                 double[] point2,
                 javax.vecmath.Color3f color)
Creates and returns a new element representing a segment from 2 points in n-dimensional space.

Parameters:
point1 - the 1st point in n-dimensional Euclidean space.
point2 - the 2nd point in n-dimensional Euclidean space.
color - the color of the element (null color is white by default).

NDElement

public NDElement(double[] point1,
                 double[] point2,
                 double[] point3,
                 javax.vecmath.Color3f color)
Creates and returns a new element representing a triangle from 3 points in n-dimensional space.

Parameters:
point1 - the 1st point in n-dimensional Euclidean space.
point2 - the 2nd point in n-dimensional Euclidean space.
point3 - the 3th point in n-dimensional Euclidean space.
color - the color of the element (null color is white by default).
Method Detail

getMultiVector

public final jclifford.CliffordBitSet getMultiVector()
Get Clifford multivector representing this NDElement.

Returns:
Clifford multivector representing this NDElement.

getGenerators

public final java.util.ArrayList getGenerators()
Get generator's arraylist.

Returns:
generator's arraylist.

getGeneratorsSize

public final int getGeneratorsSize()
Get generator's arraylist size.

Returns:
generator's arraylist size.

addGenerator

public final void addGenerator(double[] point)
Add a specified generator to generator's arraylist.

Parameters:
point - the specified generator that is to be added.

getColor

public final javax.vecmath.Color3f getColor()
Gets Clifford multivector's color.

Returns:
Clifford multivector's color.

setColor

public final void setColor(javax.vecmath.Color3f color)
Set Clifford multivector's color.

Parameters:
color - Clifford multivector's color.

toHomoVector

public static final jclifford.CliffordBitSet toHomoVector(double[] point)
Creates a point in (n+1)-dimensional homogeneous space setting the homogeneous dimension.

Parameters:
point - the Euclidean point that is to be mapped in affine coordinates.

createMultiVector

private static final jclifford.CliffordBitSet createMultiVector(java.util.ArrayList generators)
Computes Clifford homogeneous multiVector from the wedge product of all generators.

Parameters:
generators - the generator's array list.
Returns:
Clifford multiVector from the wedge product of all generators.

getSmallestCommonSubspace

private final jclifford.CliffordBitSet getSmallestCommonSubspace(NDElement el)
Computes smallest common subspace with the specified NDElement.

Parameters:
el - the second element spanning the smallest pair common subspace.
Returns:
smallest common subspace with the specified NDElement.

getRotor

public static final jclifford.CliffordBitSet getRotor(double[] v1,
                                                      double[] v2,
                                                      double angle)
Creates and returns a Clifford rotor in the specified plane of a specified angle. The plane's pseudoscalar is retrieved from the spanning of the specified versors.

Parameters:
v1 - the 1st versor in the rotation plane.
v2 - the 2nd versor in the rotation plane.
angle - the rotation angle, in degrees.
Returns:
a Clifford rotor in the specified plane of a specified angle.

rotate

public final NDElement rotate(double[] v1,
                              double[] v2,
                              double angle)
Rotates this element in the specified plane. It is achomplished by rotating the mulivector denoting the subspace and all the generators.

Parameters:
v1 - the 1st versor in the rotation plane.
v2 - the 2nd versor in the rotation plane.
angle - the rotation angle, in degrees.
Returns:
a new element rotating this element in the specified plane of a specified angle.

translate

public final NDElement translate(double[] v)
Tralslates this element by the specified vector. It is achomplished by translating all the generators.

Parameters:
v - the tranlation vector.
Returns:
a new element translating this element by the specified vector.

project

public final NDElement project(double[] f,
                               double[] p1,
                               double[] p2,
                               double[] p3)
Projects this element from the specified focus in the specified plane. It is achomplished by projecting all the generators.

Parameters:
f - the viewpoint of the projection.
p1 - the 1st point indentifyng the projection plane.
p2 - the 2nd point indentifyng the projection plane.
p3 - the 3th point indentifyng the projection plane.
Returns:
the projected NDElement from this transformation.

intersect

public final jclifford.CliffordBitSet intersect(NDElement el)
Computes the common intersection subspace of this element and the specified element. It is achomplished by taking the meet of the multivectors (respect to their join).

Parameters:
el - the second element of the intersection.
Returns:
a clifford element denoting the common intersection subspace with the specified element.

toString

public java.lang.String toString()
Returns a string representation of this Object.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this Object.

clone

public java.lang.Object clone()
Creates and returns a Clifford element deeply cloning this Clifford element. return a Clifford element deeply cloning this Clifford element.

Overrides:
clone in class java.lang.Object

package jndclifford

package jndclifford API Specification