View Javadoc

1   /*
2    * Created on Jul 24, 2004
3    *
4    * TODO To change the template for this generated file go to
5    * Window - Preferences - Java - Code Style - Code Templates
6    */
7   package net.sourceforge.kamiwaai.geometricalgebra;
8   
9   /***
10   * @author Administrator
11   *
12   * TODO To change the template for this generated type comment go to
13   * Window - Preferences - Java - Code Style - Code Templates
14   */
15  public abstract class GeometricObject implements HomogeneousModel, SwingDrawable {
16  	static MultiVector n = MultiVectors.n();
17  	static MultiVector nbar = MultiVectors.nbar();
18  	static MultiVector N = MultiVectors.N();
19  	static MultiVector One = MultiVectors.One();
20  	static MultiVector I = MultiVectors.I();
21  	static MultiVector e1 = MultiVectors.e1();
22  	static MultiVector e2 = MultiVectors.e2();
23  	static MultiVector e3 = MultiVectors.e3();
24  	MultiVector L;
25  	GeometricObject(){
26  		
27  	}
28  	protected GeometricObject(MultiVector L){
29  		this.L = L;
30  	}
31  	public int hashCode() {
32  		// TODO Auto-generated method stub
33  		return super.hashCode();
34  	}
35  	public String toString() {
36  		return L.toString();
37  	}
38  	public boolean equals(Object obj) {
39  		if (obj == null || !(obj instanceof GeometricObject))
40  			return false;
41  		GeometricObject other = (GeometricObject) obj;
42  		if (other.L.equals(this.L))
43  			return true;
44  		return false;
45  	}
46  	public MultiVector getMultiVector() {
47  		return L;
48  	}
49  	public MultiVector meet(HomogeneousModel model) {
50  		return model.getMultiVector().Rcontract(I.mult(L));
51  	}
52  
53  }