package updated
This commit is contained in:
parent
405dc0096a
commit
7ca0e4c33a
8 changed files with 17 additions and 10 deletions
|
@ -1,3 +1,3 @@
|
|||
Manifest-Version: 1.0
|
||||
Main-Class: fr.alnotz.Application
|
||||
Main-Class: fr.alnotz.quaternion.Application
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package fr.alnotz;
|
||||
package fr.alnotz.quaternion;
|
||||
|
||||
public class Application {
|
||||
public static void main(String[] args){
|
||||
|
@ -7,5 +7,7 @@ public class Application {
|
|||
System.out.println(dual);
|
||||
Quaternion quaternion = new Quaternion(21, 45, 7, -9);
|
||||
System.out.println(quaternion);
|
||||
DualQuaternion dualQuaternion = new DualQuaternion(quaternion, quaternion.conjugate());
|
||||
System.out.println(dualQuaternion);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package fr.alnotz;
|
||||
package fr.alnotz.quaternion;
|
||||
|
||||
public class Dual implements IsDual{
|
||||
private double r;
|
|
@ -1,4 +1,4 @@
|
|||
package fr.alnotz;
|
||||
package fr.alnotz.quaternion;
|
||||
|
||||
public class DualQuaternion implements IsDualQuaternion {
|
||||
private double rs;
|
||||
|
@ -254,9 +254,8 @@ public class DualQuaternion implements IsDualQuaternion {
|
|||
this.ri * dualQuaternion.getDJ() + this.di * dualQuaternion.getRJ() -
|
||||
this.rj * dualQuaternion.getDI() - this.dj * dualQuaternion.getRI() +
|
||||
this.rk * dualQuaternion.getDS() + this.dk * dualQuaternion.getRS();
|
||||
IsDualQuaternion newDQ = new DualQuaternion(newRS, newRI, newRJ, newRK,
|
||||
return new DualQuaternion(newRS, newRI, newRJ, newRK,
|
||||
newDS, newDI, newDJ, newDK);
|
||||
return newDQ;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -270,4 +269,9 @@ public class DualQuaternion implements IsDualQuaternion {
|
|||
this.dj == dualQuaternion.getDJ() &&
|
||||
this.dk == dualQuaternion.getDK();
|
||||
}
|
||||
public String toString(){
|
||||
return String.format("%+f %+fi %+fj %+fk %+fε %+fiε %+fjε %+fkε\n",
|
||||
this.rs, this.ri, this.rj, this.rk,
|
||||
this.ds, this.di, this.dj, this.dk);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package fr.alnotz;
|
||||
package fr.alnotz.quaternion;
|
||||
|
||||
public interface IsDual {
|
||||
double getR();
|
|
@ -1,4 +1,4 @@
|
|||
package fr.alnotz;
|
||||
package fr.alnotz.quaternion;
|
||||
|
||||
public interface IsDualQuaternion {
|
||||
IsQuaternion getR();
|
||||
|
@ -32,4 +32,5 @@ public interface IsDualQuaternion {
|
|||
IsDualQuaternion plus(IsDualQuaternion dualQuaternion);
|
||||
IsDualQuaternion times(IsDualQuaternion dualQuaternion);
|
||||
boolean equals(IsDualQuaternion dualQuaternion);
|
||||
String toString();
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package fr.alnotz;
|
||||
package fr.alnotz.quaternion;
|
||||
|
||||
public interface IsQuaternion {
|
||||
double getS();
|
|
@ -1,4 +1,4 @@
|
|||
package fr.alnotz;
|
||||
package fr.alnotz.quaternion;
|
||||
|
||||
public class Quaternion implements IsQuaternion{
|
||||
private double s;
|
Loading…
Reference in a new issue