anar

Class Vertex

java.lang.Object
  extended by anar.Vertex
All Implemented Interfaces:
iArithmetic, iTransformable, XYZ, java.lang.Cloneable

public class Vertex
extends java.lang.Object
implements java.lang.Cloneable, XYZ

This Class is non-Parametric class. It's used for common geometric operation. Mainly used for hard calculation, or tempoary calculation. Here, everything is public (x,y,z) (gll) Vertex Could not extends Pt beacause Pt extends Parametric


Field Summary
 float x
           
 float y
           
 float z
           
 
Constructor Summary
Vertex(float x, float y)
           
Vertex(float x, float y, float z)
          If no value submitted, the point is randomly initialized.
Vertex(XYZ p)
          If no value submitted, the point is randomly initialized.
 
Method Summary
 Vertex apply(Transform t)
           
 Vertex calculate(PMatrix3D m)
          Update the new values of the vertex with sent transformation (matrix).
 java.lang.Object clone()
           
 Vertex cross(XYZ b)
           
static Vertex cross(XYZ a, XYZ b)
           
 XYZ divide(float k)
           
 XYZ divide(float k, float l)
           
 XYZ divide(float k, float l, float m)
           
 Vertex divide(Vertex p)
           
 XYZ divide(XYZ p)
           
static Vertex divide(XYZ v1, XYZ v2)
           
 float dot(XYZ v)
           
static float dot(XYZ v0, XYZ v1)
           
 void draw()
           
 boolean equalsPt(XYZ v)
           
 Pt get()
           
 float length()
           
 float length(XYZ p)
           
 float lengthNoSq()
          Deprecated 
 float lengthNoSq(XYZ p)
          Deprecated 
 float lengthSq()
           
 float lengthSq(XYZ p)
           
 XYZ minus(float k)
           
 XYZ minus(float k, float l)
           
 XYZ minus(float k, float l, float m)
           
 Vertex minus(Vertex p)
           
 XYZ minus(XYZ p)
           
static Vertex minus(XYZ v1, XYZ v2)
           
 XYZ multiply(float k)
           
 XYZ multiply(float k, float l)
           
 XYZ multiply(float k, float l, float m)
           
 Vertex multiply(Vertex p)
           
static XYZ multiply(Vertex v1, float d)
           
 XYZ multiply(XYZ p)
           
static Vertex multiply(XYZ v1, XYZ v2)
           
 Vertex normal(XYZ b, XYZ c)
           
static Vertex normal(XYZ a, XYZ b, XYZ c)
           
 Vertex normalize()
           
 Vertex normalize(float k)
           
 XYZ plus(float k)
           
 XYZ plus(float k, float l)
           
 XYZ plus(float k, float l, float m)
           
 java.lang.String plus(java.lang.String s)
           
 Vertex plus(Vertex p)
           
 XYZ plus(XYZ p)
           
static Vertex plus(XYZ v1, XYZ v2)
           
 Vertex rotateX(float r)
           
 Vertex rotateX(Param v)
           
 Vertex rotateXDeg(float r)
           
 Vertex rotateY(float r)
           
 Vertex rotateY(Param v)
           
 Vertex rotateYDeg(float r)
           
 Vertex rotateZ(float r)
           
 Vertex rotateZ(Param v)
           
 Vertex rotateZDeg(float r)
           
 Vertex scale(float x)
           
 Vertex scale(float x, float y)
           
 Vertex scale(float x, float y, float z)
           
 Vertex scale(Param x)
           
 Vertex scale(Param x, Param y)
           
 Vertex scale(Param x, Param y, Param z)
           
 Vertex scale(Pt vector)
           
 Vertex scale(XYZ p)
           
static Vertex scale(XYZ v1, XYZ v2)
           
 Vertex scaleX(float x)
           
 Vertex scaleX(Param x)
           
 Vertex scaleY(float y)
           
 Vertex scaleY(Param y)
           
 Vertex scaleZ(float z)
           
 Vertex scaleZ(Param z)
           
 void set(float x)
           
 void set(float x, float y)
           
 void set(float x, float y, float z)
           
 void set(Param x)
           
 void set(Param x, Param y)
           
 void set(Param x, Param y, Param z)
           
 void set(Vertex v)
           
 void set(XYZ p)
           
 java.lang.String toString()
           
 Vertex toUnit()
           
 Vertex transform(Transform t)
           
 Vertex translate(float x, float y)
           
 Vertex translate(float x, float y, float z)
           
 Vertex translate(Param x, Param y)
           
 Vertex translate(Param x, Param y, Param z)
           
 Vertex translate(Pt vector)
           
 Vertex translate(XYZ p)
           
static Vertex translate(XYZ v1, XYZ v2)
           
 Vertex translateX(float x)
           
 Vertex translateX(Param x)
           
 Vertex translateY(float y)
           
 Vertex translateY(Param y)
           
 Vertex translateZ(float z)
           
 Vertex translateZ(Param z)
           
 void update()
           
 float x()
           
 void x(float x)
           
 void x(Param p)
           
 float y()
           
 void y(float y)
           
 void y(Param p)
           
 float z()
           
 void z(float z)
           
 void z(Param p)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public float x

y

public float y

z

public float z
Constructor Detail

Vertex

public Vertex(float x,
              float y)

Vertex

public Vertex(float x,
              float y,
              float z)
If no value submitted, the point is randomly initialized.

Parameters:
(x) - the x coordinate.
(y) - the y coordinate.
(z) - the z coordinate.

Vertex

public Vertex(XYZ p)
If no value submitted, the point is randomly initialized.

Parameters:
(p) - Construct with a point.
Method Detail

x

public float x()
Specified by:
x in interface XYZ

y

public float y()
Specified by:
y in interface XYZ

z

public float z()
Specified by:
z in interface XYZ

get

public Pt get()

set

public void set(Vertex v)

update

public void update()

x

public void x(float x)
Specified by:
x in interface XYZ

y

public void y(float y)
Specified by:
y in interface XYZ

z

public void z(float z)
Specified by:
z in interface XYZ

set

public void set(float x,
                float y,
                float z)
Specified by:
set in interface XYZ

set

public void set(float x,
                float y)
Specified by:
set in interface XYZ

set

public void set(float x)
Specified by:
set in interface XYZ

set

public void set(XYZ p)
Specified by:
set in interface XYZ

set

public void set(Param x,
                Param y,
                Param z)
Specified by:
set in interface XYZ

set

public void set(Param x,
                Param y)
Specified by:
set in interface XYZ

set

public void set(Param x)
Specified by:
set in interface XYZ

x

public void x(Param p)
Specified by:
x in interface XYZ

y

public void y(Param p)
Specified by:
y in interface XYZ

z

public void z(Param p)
Specified by:
z in interface XYZ

plus

public XYZ plus(float k)
Specified by:
plus in interface iArithmetic

plus

public XYZ plus(float k,
                float l)
Specified by:
plus in interface iArithmetic

plus

public XYZ plus(float k,
                float l,
                float m)
Specified by:
plus in interface iArithmetic

plus

public XYZ plus(XYZ p)
Specified by:
plus in interface iArithmetic

plus

public Vertex plus(Vertex p)

plus

public static Vertex plus(XYZ v1,
                          XYZ v2)

minus

public XYZ minus(float k)
Specified by:
minus in interface iArithmetic

minus

public XYZ minus(float k,
                 float l)
Specified by:
minus in interface iArithmetic

minus

public XYZ minus(float k,
                 float l,
                 float m)
Specified by:
minus in interface iArithmetic

minus

public XYZ minus(XYZ p)
Specified by:
minus in interface iArithmetic

minus

public Vertex minus(Vertex p)

minus

public static Vertex minus(XYZ v1,
                           XYZ v2)

multiply

public XYZ multiply(float k)
Specified by:
multiply in interface iArithmetic

multiply

public XYZ multiply(float k,
                    float l)
Specified by:
multiply in interface iArithmetic

multiply

public XYZ multiply(float k,
                    float l,
                    float m)
Specified by:
multiply in interface iArithmetic

multiply

public XYZ multiply(XYZ p)
Specified by:
multiply in interface iArithmetic

multiply

public Vertex multiply(Vertex p)

multiply

public static Vertex multiply(XYZ v1,
                              XYZ v2)

multiply

public static XYZ multiply(Vertex v1,
                           float d)

divide

public XYZ divide(float k,
                  float l,
                  float m)
Specified by:
divide in interface iArithmetic

divide

public XYZ divide(float k,
                  float l)
Specified by:
divide in interface iArithmetic

divide

public XYZ divide(float k)
Specified by:
divide in interface iArithmetic

divide

public XYZ divide(XYZ p)
Specified by:
divide in interface iArithmetic

divide

public Vertex divide(Vertex p)

divide

public static Vertex divide(XYZ v1,
                            XYZ v2)

transform

public Vertex transform(Transform t)
Parameters:
t - Transform Matrix (could be complex) This function wl use parametric operation with vertex

rotateX

public Vertex rotateX(float r)

rotateX

public Vertex rotateX(Param v)

rotateY

public Vertex rotateY(float r)

rotateY

public Vertex rotateY(Param v)

rotateZ

public Vertex rotateZ(float r)

rotateZ

public Vertex rotateZ(Param v)

scale

public Vertex scale(float x)

scale

public Vertex scale(float x,
                    float y)

scale

public Vertex scale(float x,
                    float y,
                    float z)

scale

public Vertex scale(XYZ p)

scale

public Vertex scale(Pt vector)

scale

public static Vertex scale(XYZ v1,
                           XYZ v2)

scale

public Vertex scale(Param x,
                    Param y,
                    Param z)

scale

public Vertex scale(Param x,
                    Param y)

scale

public Vertex scale(Param x)

scaleX

public Vertex scaleX(float x)

scaleX

public Vertex scaleX(Param x)

scaleY

public Vertex scaleY(float y)

scaleY

public Vertex scaleY(Param y)

scaleZ

public Vertex scaleZ(float z)

scaleZ

public Vertex scaleZ(Param z)

translate

public Vertex translate(float x,
                        float y,
                        float z)

translate

public Vertex translate(XYZ p)

translate

public Vertex translate(Pt vector)

translate

public static Vertex translate(XYZ v1,
                               XYZ v2)

translate

public Vertex translate(float x,
                        float y)

translate

public Vertex translate(Param x,
                        Param y,
                        Param z)

translate

public Vertex translate(Param x,
                        Param y)

translateX

public Vertex translateX(float x)

translateX

public Vertex translateX(Param x)

translateY

public Vertex translateY(float y)

translateY

public Vertex translateY(Param y)

translateZ

public Vertex translateZ(float z)

translateZ

public Vertex translateZ(Param z)

apply

public Vertex apply(Transform t)

rotateXDeg

public Vertex rotateXDeg(float r)

rotateYDeg

public Vertex rotateYDeg(float r)

rotateZDeg

public Vertex rotateZDeg(float r)

cross

public static Vertex cross(XYZ a,
                           XYZ b)

cross

public Vertex cross(XYZ b)

dot

public static float dot(XYZ v0,
                        XYZ v1)
Parameters:
v0 -
v1 -
Returns:

dot

public float dot(XYZ v)
Specified by:
dot in interface XYZ

length

public float length()
Specified by:
length in interface XYZ

lengthSq

public float lengthSq()
Specified by:
lengthSq in interface XYZ

lengthNoSq

@Deprecated
public float lengthNoSq()
Deprecated 


length

public float length(XYZ p)
Specified by:
length in interface XYZ

lengthSq

public float lengthSq(XYZ p)
Specified by:
lengthSq in interface XYZ

lengthNoSq

@Deprecated
public float lengthNoSq(XYZ p)
Deprecated 


normalize

public Vertex normalize()

normalize

public Vertex normalize(float k)

normal

public Vertex normal(XYZ b,
                     XYZ c)

normal

public static Vertex normal(XYZ a,
                            XYZ b,
                            XYZ c)

toUnit

public Vertex toUnit()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

plus

public java.lang.String plus(java.lang.String s)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

draw

public void draw()
Specified by:
draw in interface XYZ

equalsPt

public boolean equalsPt(XYZ v)
Specified by:
equalsPt in interface XYZ

calculate

public Vertex calculate(PMatrix3D m)
Update the new values of the vertex with sent transformation (matrix).

Parameters:
m -