@StarGate01
Meine Rotate-Methode ist in der Point3D Klasse. Hier der Code:
Wie muss ich diese Methode abändern, damit ich den Punkt um den Mittelpunkt des Rubiks Cubes den Punkt drehe?
Sorry aber ich check das nicht ganz ab
Gruß
Switcherlapp97
Meine Rotate-Methode ist in der Point3D Klasse. Hier der Code:
C#-Quellcode
- public Point3D Rotate(RotationType type, int angle)
- {
- double rad = angle * Math.PI / 180;
- double cosa = Math.Cos(rad);
- double sina = Math.Sin(rad);
- switch (type)
- {
- case RotationType.X:
- return new Point3D(this.X, this.Y * cosa - this.Z * sina, this.Y * sina + this.Z * cosa);
- case RotationType.Y:
- return new Point3D(this.Z * sina + this.X * cosa, this.Y, this.Z * cosa - this.X * sina);
- default:
- return new Point3D(this.X * cosa - this.Y * sina, this.X * sina + this.Y * cosa, this.Z);
- }
- }
Wie muss ich diese Methode abändern, damit ich den Punkt um den Mittelpunkt des Rubiks Cubes den Punkt drehe?
Sorry aber ich check das nicht ganz ab
Gruß
Switcherlapp97