mirror of
https://github.com/csharpee/Map-Projections.git
synced 2025-12-16 00:00:06 -05:00
It works!
The AuthaGraph projection is a go! Sure, it doesn't preserve area, and it looks like garbage, but it looks decent! We'll get there. Probably tomorrow.
This commit is contained in:
parent
59ee92ce45
commit
2872c49c08
Binary file not shown.
Binary file not shown.
@ -390,11 +390,9 @@ public class MapProjections extends Application {
|
|||||||
lonf = lon0 -
|
lonf = lon0 -
|
||||||
Math.acos(innerFunc);
|
Math.acos(innerFunc);
|
||||||
|
|
||||||
double P = Math.sin(lat0)*Math.cos(latf)-Math.cos(lat0)*Math.sin(latf)*Math.cos(lonf-lon0);
|
double thtf = 0;
|
||||||
double thtf = Math.acos(P/Math.cos(lat1));
|
if (pole.length >= 3)
|
||||||
thtf = 0;
|
thtf += pole[2];
|
||||||
if (coords.length >= 3)
|
|
||||||
thtf += coords[2];
|
|
||||||
|
|
||||||
double[] output = {latf, lonf, thtf};
|
double[] output = {latf, lonf, thtf};
|
||||||
return output;
|
return output;
|
||||||
@ -584,40 +582,39 @@ public class MapProjections extends Application {
|
|||||||
final double[] faceCenter = new double[3];
|
final double[] faceCenter = new double[3];
|
||||||
final double localX, localY;
|
final double localX, localY;
|
||||||
if (y-1 < 4*x && y-1 < -4*x) {
|
if (y-1 < 4*x && y-1 < -4*x) {
|
||||||
//faceCenter[0] = Math.asin(Math.sqrt(8)/3)-Math.PI/2;
|
faceCenter[0] = Math.PI/2-Math.asin(Math.sqrt(8)/3);
|
||||||
faceCenter[0] = 0.7;
|
|
||||||
faceCenter[1] = 0;
|
faceCenter[1] = 0;
|
||||||
faceCenter[2] = 0;
|
faceCenter[2] = 0;
|
||||||
localX = 2*x;
|
localX = 2*x;
|
||||||
localY = y-1/3.0;
|
localY = y+1/3.0;
|
||||||
}
|
}
|
||||||
else if (y-1 < -4*(x+1)) {
|
else if (y-1 < -4*(x+1)) {
|
||||||
faceCenter[0] = Math.PI/2;
|
faceCenter[0] = -Math.PI/2;
|
||||||
faceCenter[1] = 0;
|
faceCenter[1] = 0;
|
||||||
faceCenter[2] = 0;
|
faceCenter[2] = Math.PI;
|
||||||
localX = 2*(x+1);
|
localX = 2*(x+1);
|
||||||
localY = y-1/3.0;
|
localY = y+1/3.0;
|
||||||
}
|
}
|
||||||
else if (y-1 < 4*(x-1)) {
|
else if (y-1 < 4*(x-1)) {
|
||||||
faceCenter[0] = Math.PI/2;
|
faceCenter[0] = -Math.PI/2;
|
||||||
faceCenter[1] = 0;
|
faceCenter[1] = 0;
|
||||||
faceCenter[2] = 0;
|
faceCenter[2] = Math.PI;
|
||||||
localX = 2*(x-1);
|
localX = 2*(x-1);
|
||||||
localY = y-1/3.0;
|
localY = y+1/3.0;
|
||||||
}
|
}
|
||||||
else if (x < 0) {
|
else if (x < 0) {
|
||||||
faceCenter[0] = Math.asin(Math.sqrt(8)/3)-Math.PI/2;
|
faceCenter[0] = Math.PI/2-Math.asin(Math.sqrt(8)/3);
|
||||||
faceCenter[1] = 4*Math.PI/3;
|
faceCenter[1] = 4*Math.PI/3;
|
||||||
faceCenter[2] = Math.PI/3;
|
faceCenter[2] = Math.PI/3;
|
||||||
localX = 2*(x+0.5);
|
localX = 2*(x+0.5);
|
||||||
localY = y+1/3.0;
|
localY = y-1/3.0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
faceCenter[0] = Math.asin(Math.sqrt(8)/3)-Math.PI/2;
|
faceCenter[0] = Math.PI/2-Math.asin(Math.sqrt(8)/3);
|
||||||
faceCenter[1] =2*Math.PI/3;
|
faceCenter[1] =2*Math.PI/3;
|
||||||
faceCenter[2] = -Math.PI/3;
|
faceCenter[2] = -Math.PI/3;
|
||||||
localX = 2*(x-0.5);
|
localX = 2*(x-0.5);
|
||||||
localY = y+1/3.0;
|
localY = y-1/3.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
double[] triCoords = {
|
double[] triCoords = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user