Created
October 12, 2017 15:16
-
-
Save grkvlt/b3b893ff1dedaa787dd902626b6a9cad to your computer and use it in GitHub Desktop.
Exploring Iterated Function Systems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public Point2D apply(Point2D src) { | |
double ox = sw / 2d; | |
double oy = sh / 2d; | |
double u = Point2D.distance(0d, 0d, ox / 2d, oy / 2d); | |
double r = Point2D.distance(ox, oy, src.getX(), src.getY()) / u; | |
double scale = 1d / (r * r); | |
double x = (src.getX() - ox) / u; | |
double y = (src.getY() - oy) / u; | |
double fx = ox + (u * scale * x); | |
double fy = oy + (u * scale * y); | |
return new Point2D.Double(fx, fy); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment