Skip to content

Commit

Permalink
Details only.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Dec 13, 2024
1 parent 7b515ad commit 17ab1d9
Showing 1 changed file with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.util.function.UnaryOperator;

import org.meeuw.math.Utils;
import org.meeuw.math.abstractalgebra.GroupElement;
import org.meeuw.math.abstractalgebra.dim2.Matrix2;
import org.meeuw.math.abstractalgebra.dim2.Vector2;
Expand Down Expand Up @@ -97,21 +98,21 @@ public String toString() {

public Matrix2 asMatrix2() {
if (asMatrix == null) {
double phi = 2 * Math.PI * k / group.n;
double cos = Math.cos(phi);
double sin = Math.sin(phi);
if (symmetry == r) {
return Matrix2.of(
cos, -1 * sin,
sin, cos
);
} else {
return Matrix2.of(
cos, sin,
sin, -1 * cos
);
double phi = Utils.Math_2PI * k / group.n;
double cos = Math.cos(phi);
double sin = Math.sin(phi);
if (symmetry == r) {
return Matrix2.of(
cos, -1 * sin,
sin, cos
);
} else {
return Matrix2.of(
cos, sin,
sin, -1 * cos
);
}
}
}
return asMatrix;
}

Expand Down

0 comments on commit 17ab1d9

Please sign in to comment.