vmm.core
Class LinearAlgebra

java.lang.Object
  extended by vmm.core.LinearAlgebra

public class LinearAlgebra
extends java.lang.Object

The class LinearAlgebra provides more methods to the class Point2D


Constructor Summary
LinearAlgebra()
           
 
Method Summary
static void assignMinus2D(java.awt.geom.Point2D P2, java.awt.geom.Point2D P1)
          public void assignMinus2D(Point2D P2, Point2D P1) assigns to P2 the value (P2 - P1).
static java.awt.geom.Point2D convexCombination(double t, java.awt.geom.Point2D P1, java.awt.geom.Point2D P2)
          public Point2D convexCombination(double t, Point2D P1, Point2D P2) returns a new object with value P1 + t*(P2-P1).
 double determinant(java.awt.geom.Point2D P, java.awt.geom.Point2D Q)
          public double determinant(Point2D P, Point2D Q) returns (P.x*Q.y - P.y*Q.x).
static double dotProduct(java.awt.geom.Point2D P, java.awt.geom.Point2D Q)
          public double dotProduct(Point2D P, Point2D Q) returns (P.x*Q.x + P.y*Q.y).
static java.awt.geom.Point2D intersectTwoLines(double P1x, double P1y, double P2x, double P2y, double Q1x, double Q1y, double Q2x, double Q2y)
          public Point2D intersectTwoLines(double P1x, double P1y, double P2x, double P2y, double Q1x, double Q1y, double Q2x, double Q2y) returns the intersection point of P1 + s(P2 - P1) and Q1 + t(Q2 - Q1), where these four points are given by their double coordinates.
static java.awt.geom.Point2D intersectTwoLines(java.awt.geom.Point2D P1, java.awt.geom.Point2D P2, java.awt.geom.Point2D Q1, java.awt.geom.Point2D Q2)
          public Point2D intersectTwoLines(Point2D P1, Point2D P2, Point2D Q1, Point2D Q2) returns the intersection point of P1 + s(P2 - P1) and Q1 + t(Q2 - Q1).
static java.awt.geom.Point2D linearCombination(double t1, double t2, java.awt.geom.Point2D P1, java.awt.geom.Point2D P2)
          public Point2D convexCombination(double t1, double t2, Point2D P1, Point2D P2) returns a new object with value (t1*P1 + t2*P2).
static java.awt.geom.Point2D minus2D(java.awt.geom.Point2D P2, java.awt.geom.Point2D P1)
          public Point2D minus2D(Point2D P2, Point2D P1) returns a new object with value (P2 - P1).
static java.awt.geom.Point2D normalTo(java.awt.geom.Point2D P)
          public Point2D normalTo(Point2D P) returns new object N = (P.y, -P.x).
static java.awt.geom.Point2D normalTo(java.awt.geom.Point2D P2, java.awt.geom.Point2D P1)
          public Point2D normalTo(Point2D P2, Point2D P1) = normalTo(minus2D(P2,P1)).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearAlgebra

public LinearAlgebra()
Method Detail

minus2D

public static java.awt.geom.Point2D minus2D(java.awt.geom.Point2D P2,
                                            java.awt.geom.Point2D P1)
public Point2D minus2D(Point2D P2, Point2D P1) returns a new object with value (P2 - P1).


assignMinus2D

public static void assignMinus2D(java.awt.geom.Point2D P2,
                                 java.awt.geom.Point2D P1)
public void assignMinus2D(Point2D P2, Point2D P1) assigns to P2 the value (P2 - P1).


convexCombination

public static java.awt.geom.Point2D convexCombination(double t,
                                                      java.awt.geom.Point2D P1,
                                                      java.awt.geom.Point2D P2)
public Point2D convexCombination(double t, Point2D P1, Point2D P2) returns a new object with value P1 + t*(P2-P1).


linearCombination

public static java.awt.geom.Point2D linearCombination(double t1,
                                                      double t2,
                                                      java.awt.geom.Point2D P1,
                                                      java.awt.geom.Point2D P2)
public Point2D convexCombination(double t1, double t2, Point2D P1, Point2D P2) returns a new object with value (t1*P1 + t2*P2).


normalTo

public static java.awt.geom.Point2D normalTo(java.awt.geom.Point2D P)
public Point2D normalTo(Point2D P) returns new object N = (P.y, -P.x).


normalTo

public static java.awt.geom.Point2D normalTo(java.awt.geom.Point2D P2,
                                             java.awt.geom.Point2D P1)
public Point2D normalTo(Point2D P2, Point2D P1) = normalTo(minus2D(P2,P1)).


dotProduct

public static double dotProduct(java.awt.geom.Point2D P,
                                java.awt.geom.Point2D Q)
public double dotProduct(Point2D P, Point2D Q) returns (P.x*Q.x + P.y*Q.y).


determinant

public double determinant(java.awt.geom.Point2D P,
                          java.awt.geom.Point2D Q)
public double determinant(Point2D P, Point2D Q) returns (P.x*Q.y - P.y*Q.x).


intersectTwoLines

public static java.awt.geom.Point2D intersectTwoLines(java.awt.geom.Point2D P1,
                                                      java.awt.geom.Point2D P2,
                                                      java.awt.geom.Point2D Q1,
                                                      java.awt.geom.Point2D Q2)
public Point2D intersectTwoLines(Point2D P1, Point2D P2, Point2D Q1, Point2D Q2) returns the intersection point of P1 + s(P2 - P1) and Q1 + t(Q2 - Q1). Creates the return Point2D.


intersectTwoLines

public static java.awt.geom.Point2D intersectTwoLines(double P1x,
                                                      double P1y,
                                                      double P2x,
                                                      double P2y,
                                                      double Q1x,
                                                      double Q1y,
                                                      double Q2x,
                                                      double Q2y)
public Point2D intersectTwoLines(double P1x, double P1y, double P2x, double P2y, double Q1x, double Q1y, double Q2x, double Q2y) returns the intersection point of P1 + s(P2 - P1) and Q1 + t(Q2 - Q1), where these four points are given by their double coordinates. Creates the return Point2D.