Skip to content
Snippets Groups Projects

Refactored: JuliaTransform method

Merged Tam Minh Le requested to merge task.1.3 into main
1 file
+ 5
10
Compare changes
  • Side-by-side
  • Inline
@@ -11,18 +11,13 @@ public class JuliaTransform implements Transform2D{
@Override
public Vector2D transform(Vector2D point) {
double x = point.getX0();
double y = point.getX1();
double newX = x * x - y * y + this.point.getX0();
double newY = 2 * x * y + this.point.getX1();
if (sign == -1) {
newX = -newX;
newY = -newY;
if (!(point instanceof Complex)) {
throw new IllegalArgumentException("The point must be a complex number");
}
return new Vector2D(newX, newY);
Complex newVector = (Complex) point.subtract(this.point);
return newVector.sqrt();
}
}
Loading