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
|
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 class Application {
|
||||||
public static void main(String[] args){
|
public static void main(String[] args){
|
||||||
|
@ -7,5 +7,7 @@ public class Application {
|
||||||
System.out.println(dual);
|
System.out.println(dual);
|
||||||
Quaternion quaternion = new Quaternion(21, 45, 7, -9);
|
Quaternion quaternion = new Quaternion(21, 45, 7, -9);
|
||||||
System.out.println(quaternion);
|
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{
|
public class Dual implements IsDual{
|
||||||
private double r;
|
private double r;
|
|
@ -1,4 +1,4 @@
|
||||||
package fr.alnotz;
|
package fr.alnotz.quaternion;
|
||||||
|
|
||||||
public class DualQuaternion implements IsDualQuaternion {
|
public class DualQuaternion implements IsDualQuaternion {
|
||||||
private double rs;
|
private double rs;
|
||||||
|
@ -254,9 +254,8 @@ public class DualQuaternion implements IsDualQuaternion {
|
||||||
this.ri * dualQuaternion.getDJ() + this.di * dualQuaternion.getRJ() -
|
this.ri * dualQuaternion.getDJ() + this.di * dualQuaternion.getRJ() -
|
||||||
this.rj * dualQuaternion.getDI() - this.dj * dualQuaternion.getRI() +
|
this.rj * dualQuaternion.getDI() - this.dj * dualQuaternion.getRI() +
|
||||||
this.rk * dualQuaternion.getDS() + this.dk * dualQuaternion.getRS();
|
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);
|
newDS, newDI, newDJ, newDK);
|
||||||
return newDQ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -270,4 +269,9 @@ public class DualQuaternion implements IsDualQuaternion {
|
||||||
this.dj == dualQuaternion.getDJ() &&
|
this.dj == dualQuaternion.getDJ() &&
|
||||||
this.dk == dualQuaternion.getDK();
|
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 {
|
public interface IsDual {
|
||||||
double getR();
|
double getR();
|
|
@ -1,4 +1,4 @@
|
||||||
package fr.alnotz;
|
package fr.alnotz.quaternion;
|
||||||
|
|
||||||
public interface IsDualQuaternion {
|
public interface IsDualQuaternion {
|
||||||
IsQuaternion getR();
|
IsQuaternion getR();
|
||||||
|
@ -32,4 +32,5 @@ public interface IsDualQuaternion {
|
||||||
IsDualQuaternion plus(IsDualQuaternion dualQuaternion);
|
IsDualQuaternion plus(IsDualQuaternion dualQuaternion);
|
||||||
IsDualQuaternion times(IsDualQuaternion dualQuaternion);
|
IsDualQuaternion times(IsDualQuaternion dualQuaternion);
|
||||||
boolean equals(IsDualQuaternion dualQuaternion);
|
boolean equals(IsDualQuaternion dualQuaternion);
|
||||||
|
String toString();
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package fr.alnotz;
|
package fr.alnotz.quaternion;
|
||||||
|
|
||||||
public interface IsQuaternion {
|
public interface IsQuaternion {
|
||||||
double getS();
|
double getS();
|
|
@ -1,4 +1,4 @@
|
||||||
package fr.alnotz;
|
package fr.alnotz.quaternion;
|
||||||
|
|
||||||
public class Quaternion implements IsQuaternion{
|
public class Quaternion implements IsQuaternion{
|
||||||
private double s;
|
private double s;
|
Loading…
Reference in a new issue