Skip to content
Snippets Groups Projects
Commit 9e4ad01d authored by Tam Le's avatar Tam Le
Browse files

Refactored: JuliaTransform method

parent 32024d15
No related branches found
No related tags found
1 merge request!5Refactored: JuliaTransform method
......@@ -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();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment