I underestimated the pointiness of triangles

As it turns out, they are quite pointy. And creating an authagraphic
tetrahedral projection that has to shove landmasses into the pointy
corners doesn't work very well. Oh, well. I did some fun calculus to
make it work. I don't know how AuthaGraph does it. Probably by not being
authagraphic and lying to its followers. I'll probably make something
interrupted now.
This commit is contained in:
Justin Kunimune 2017-11-21 19:23:11 -05:00
parent 223342cd16
commit 0082af3ff5
7 changed files with 67 additions and 86 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -97,9 +97,9 @@ public class MapAnalyzer extends MapApplication {
Cylindrical.BEHRMANN, Cylindrical.LAMBERT, Cylindrical.EQUAL_AREA, Cylindrical.GALL,
Azimuthal.STEREOGRAPHIC, Azimuthal.POLAR, Azimuthal.EQUAL_AREA, Azimuthal.GNOMONIC,
Azimuthal.ORTHOGRAPHIC, Azimuthal.PERSPECTIVE, Conic.LAMBERT, Conic.EQUIDISTANT,
Conic.ALBERS, Tetrahedral.LEE, Tetrahedral.TETRAGRAPH, Pseudocylindrical.SINUSOIDAL,
Pseudocylindrical.MOLLWEIDE, Tobler.TOBLER, Misc.HAMMER, Misc.AITOFF,
Misc.VAN_DER_GRINTEN, Robinson.ROBINSON, WinkelTripel.WINKEL_TRIPEL,
Conic.ALBERS, Tetrahedral.LEE, Tetrahedral.TETRAGRAPH, Tetrahedral.ACTAAUTHAGRAPH,
Pseudocylindrical.SINUSOIDAL, Pseudocylindrical.MOLLWEIDE, Tobler.TOBLER, Misc.HAMMER,
Misc.AITOFF, Misc.VAN_DER_GRINTEN, Robinson.ROBINSON, WinkelTripel.WINKEL_TRIPEL,
Misc.PEIRCE_QUINCUNCIAL, Misc.TWO_POINT_EQUIDISTANT, Misc.HAMMER_RETROAZIMUTHAL,
Pseudocylindrical.LEMONS, MyProjections.EXPERIMENT, MyProjections.PSEUDOSTEREOGRAPHIC,
MyProjections.HYPERELLIPOWER, Tetrahedral.TETRAPOWER, Tetrahedral.TETRAFILLET,

View File

@ -87,7 +87,7 @@ public class MapDesignerRaster extends MapApplication {
Cylindrical.EQUIRECTANGULAR, Cylindrical.EQUAL_AREA, Cylindrical.GALL,
Azimuthal.STEREOGRAPHIC, Azimuthal.POLAR, Azimuthal.EQUAL_AREA, Azimuthal.GNOMONIC,
Azimuthal.PERSPECTIVE, Conic.LAMBERT, Conic.EQUIDISTANT, Conic.ALBERS, Tetrahedral.LEE,
Tetrahedral.TETRAGRAPH, Tetrahedral.AUTHAGRAPH, Pseudocylindrical.SINUSOIDAL,
Tetrahedral.TETRAGRAPH, Tetrahedral.ACTAAUTHAGRAPH, Pseudocylindrical.SINUSOIDAL,
Pseudocylindrical.MOLLWEIDE, Tobler.TOBLER, Misc.AITOFF, Misc.VAN_DER_GRINTEN,
Robinson.ROBINSON, WinkelTripel.WINKEL_TRIPEL, Misc.PEIRCE_QUINCUNCIAL,
Misc.TWO_POINT_EQUIDISTANT, Misc.HAMMER_RETROAZIMUTHAL, Pseudocylindrical.LEMONS,

View File

@ -82,12 +82,13 @@ public class MapDesignerVector extends MapApplication {
Cylindrical.EQUIRECTANGULAR, Cylindrical.EQUAL_AREA, Cylindrical.GALL,
Azimuthal.STEREOGRAPHIC, Azimuthal.POLAR, Azimuthal.EQUAL_AREA, Azimuthal.GNOMONIC,
Azimuthal.PERSPECTIVE, Conic.LAMBERT, Conic.EQUIDISTANT, Conic.ALBERS, Tetrahedral.LEE,
Tetrahedral.TETRAGRAPH, Pseudocylindrical.SINUSOIDAL, Pseudocylindrical.MOLLWEIDE,
Tobler.TOBLER, Misc.AITOFF, Misc.VAN_DER_GRINTEN, Robinson.ROBINSON,
WinkelTripel.WINKEL_TRIPEL, Misc.PEIRCE_QUINCUNCIAL, Misc.TWO_POINT_EQUIDISTANT,
Misc.HAMMER_RETROAZIMUTHAL, Pseudocylindrical.LEMONS, MyProjections.EXPERIMENT,
MyProjections.PSEUDOSTEREOGRAPHIC, MyProjections.HYPERELLIPOWER, Tetrahedral.TETRAPOWER,
Tetrahedral.TETRAFILLET, MyProjections.TWO_POINT_EQUALIZED };
Tetrahedral.TETRAGRAPH, Tetrahedral.ACTAAUTHAGRAPH, Pseudocylindrical.SINUSOIDAL,
Pseudocylindrical.MOLLWEIDE, Tobler.TOBLER, Misc.AITOFF, Misc.VAN_DER_GRINTEN,
Robinson.ROBINSON, WinkelTripel.WINKEL_TRIPEL, Misc.PEIRCE_QUINCUNCIAL,
Misc.TWO_POINT_EQUIDISTANT, Misc.HAMMER_RETROAZIMUTHAL, Pseudocylindrical.LEMONS,
MyProjections.EXPERIMENT, MyProjections.PSEUDOSTEREOGRAPHIC,
MyProjections.HYPERELLIPOWER, Tetrahedral.TETRAPOWER, Tetrahedral.TETRAFILLET,
MyProjections.TWO_POINT_EQUALIZED };
private static final int DEF_MAX_VTX = 5000;
private static final int FAST_MAX_VTX = 2000;

View File

@ -61,7 +61,7 @@ public class MapExplainer {
Azimuthal.POLAR.transverse(), Azimuthal.EQUAL_AREA.transverse(),
Azimuthal.GNOMONIC.transverse(), Azimuthal.ORTHOGRAPHIC.transverse(),
Conic.LAMBERT, Conic.EQUIDISTANT, Conic.ALBERS, Tetrahedral.LEE,
Tetrahedral.TETRAGRAPH, Tetrahedral.AUTHAGRAPH, Pseudocylindrical.SINUSOIDAL,
Tetrahedral.TETRAGRAPH, Tetrahedral.ACTAAUTHAGRAPH, Pseudocylindrical.SINUSOIDAL,
Pseudocylindrical.MOLLWEIDE, Tobler.TOBLER, Misc.HAMMER, Misc.AITOFF,
Misc.VAN_DER_GRINTEN, Robinson.ROBINSON, WinkelTripel.WINKEL_TRIPEL,
Misc.PEIRCE_QUINCUNCIAL.transverse(), Misc.TWO_POINT_EQUIDISTANT,

View File

@ -51,6 +51,7 @@ import maps.Cylindrical;
import maps.Misc;
import maps.MyProjections;
import maps.Projection;
import maps.Pseudocylindrical;
import maps.Robinson;
import maps.Tetrahedral;
import maps.Tobler;
@ -65,15 +66,28 @@ public class MapPlotter extends Application {
private static final double GLOBE_RES = .002;
private static final Projection[] COMMON = { Azimuthal.STEREOGRAPHIC, Cylindrical.MERCATOR,
Azimuthal.POLAR, Cylindrical.PLATE_CARREE, Azimuthal.EQUAL_AREA,
Cylindrical.GALL_PETERS, Cylindrical.GALL, Misc.VAN_DER_GRINTEN, Robinson.ROBINSON,
WinkelTripel.WINKEL_TRIPEL, Azimuthal.ORTHOGRAPHIC };
private static final Projection[] UNCOMMON = { Misc.PEIRCE_QUINCUNCIAL, Tetrahedral.LEE,
Tobler.TOBLER, Cylindrical.BEHRMANN, Misc.AITOFF };
private static final Projection[] INVENTED = { MyProjections.PSEUDOSTEREOGRAPHIC,
MyProjections.HYPERELLIPOWER, Tetrahedral.TETRAPOWER, Tetrahedral.TETRAFILLET,
MyProjections.TWO_POINT_EQUALIZED };
private static final Projection[] CYLINDRICAL = { Cylindrical.MERCATOR,
Cylindrical.PLATE_CARREE, Cylindrical.BEHRMANN, Cylindrical.GALL };
private static final Projection[] AZIMUTHAL = { Azimuthal.STEREOGRAPHIC, Azimuthal.POLAR,
Azimuthal.EQUAL_AREA };
private static final Projection[] PSEUDOCYL = { Pseudocylindrical.MOLLWEIDE,
Robinson.ROBINSON, Tobler.TOBLER, MyProjections.HYPERELLIPOWER };
private static final Projection[] PSEUDOAZM = { Misc.AITOFF,
MyProjections.PSEUDOSTEREOGRAPHIC };
private static final Projection[] TETRAHEDRAL = { Tetrahedral.LEE, Tetrahedral.TETRAGRAPH,
Tetrahedral.ACTAAUTHAGRAPH, Tetrahedral.TETRAPOWER };
private static final Projection[] OTHER = { Misc.VAN_DER_GRINTEN, WinkelTripel.WINKEL_TRIPEL,
Misc.PEIRCE_QUINCUNCIAL };
// private static final Projection[] COMMON = { Azimuthal.STEREOGRAPHIC, Cylindrical.MERCATOR,
// Azimuthal.POLAR, Cylindrical.PLATE_CARREE, Azimuthal.EQUAL_AREA,
// Cylindrical.GALL_PETERS, Cylindrical.GALL, Misc.VAN_DER_GRINTEN, Robinson.ROBINSON,
// WinkelTripel.WINKEL_TRIPEL, Azimuthal.ORTHOGRAPHIC };
// private static final Projection[] UNCOMMON = { Misc.PEIRCE_QUINCUNCIAL, Tetrahedral.LEE,
// Tobler.TOBLER, Cylindrical.BEHRMANN, Misc.AITOFF };
// private static final Projection[] INVENTED = { MyProjections.PSEUDOSTEREOGRAPHIC,
// MyProjections.HYPERELLIPOWER, Tetrahedral.ACTAAUTHAGRAPH, Tetrahedral.TETRAPOWER,
// Tetrahedral.TETRAFILLET, MyProjections.TWO_POINT_EQUALIZED };
private StackPane stack;
@ -98,9 +112,16 @@ public class MapPlotter extends Application {
final List<Data<Number,Number>> data = new LinkedList<Data<Number,Number>>();
final double[][][] points = Projection.globe(GLOBE_RES);
plotProjections(plot, overlay, labels, data, COMMON, "Common", points);
plotProjections(plot, overlay, labels, data, UNCOMMON, "Hipster", points);
plotProjections(plot, overlay, labels, data, INVENTED, "Mine", points);
plotProjections(plot, overlay, labels, data, CYLINDRICAL, "Cylindrical", points);
plotProjections(plot, overlay, labels, data, AZIMUTHAL, "Azimuthal", points);
plotProjections(plot, overlay, labels, data, PSEUDOCYL, "Pseudocylindrical", points);
plotProjections(plot, overlay, labels, data, PSEUDOAZM, "Pseudoazimuthal", points);
plotProjections(plot, overlay, labels, data, TETRAHEDRAL, "Tetrahedral", points);
plotProjections(plot, overlay, labels, data, OTHER, "Other", points);
// plotProjections(plot, overlay, labels, data, COMMON, "Common", points);
// plotProjections(plot, overlay, labels, data, UNCOMMON, "Hipster", points);
// plotProjections(plot, overlay, labels, data, INVENTED, "Mine", points);
final ChangeListener<Number> listener = new ChangeListener<Number>() {
final Timer timer = new Timer();

View File

@ -76,6 +76,28 @@ public class Tetrahedral {
};
public static final Projection ACTAAUTHAGRAPH =
new TetrahedralProjection(
"Equahedral", 0b1011, Property.EQUAL_AREA, null, "to put AuthaGraph to shame.") {
public double[] innerProject(double lat, double lon) {
final double Lam = Math.floor(lon/(2*Math.PI/3))*(2*Math.PI/3) + Math.PI/3;
final double lam = lon - Lam;
final double tht = Math.atan((lam - Math.asin(Math.sin(lam)/Math.sqrt(3)))/Math.PI*Math.sqrt(108));
return new double[] {
Math.sqrt((1 - Math.sin(lat))/(1 - 1/Math.sqrt(1+2/Math.cos(lam))))/Math.cos(tht),
// (Math.PI/2-lat)/Math.atan(Math.sqrt(2)/Math.cos(lam))/Math.cos(tht),
Lam + tht };
}
public double[] innerInverse(double x, double y) {
// TODO: Implement this
return null;
}
};
public static final Projection TETRAPOWER =
new TetrahedralProjection(
"TetraPower", "A parameterised tetrahedral projection that I invented.",
@ -204,69 +226,6 @@ public class Tetrahedral {
};
public static final Projection AUTHAGRAPH =
new TetrahedralProjection("AuthaGraph",
"A hip new Japanese map that is almost authagraphic (this is an approximation; they won't give me their actual equations).",
0b1001, Property.COMPROMISE) {
public double[] project(double lat, double lon) {
return null; //TODO Can I live with myself if I never implement this?
}
public double[] innerProject(double lat, double lon) {
return null;
}
public double[] inverse(double x, double y) {
final double[] faceCenter;
final double dt, xp, yp;
if (y-1 < 4*x && y-1 < -4*x) {
faceCenter = new double[] { Math.PI/2-Math.asin(Math.sqrt(8)/3), 0, 0};
dt = 0;
xp = 4/Math.sqrt(3)*x;
yp = y+1/3.0;
}
else if (y-1 < -4*(x+1)) {
faceCenter = new double[] { -Math.PI/2, Math.PI, 0 };
dt = 0;
xp = 4/Math.sqrt(3)*(x+1);
yp = y+1/3.0;
}
else if (y-1 < 4*(x-1)) {
faceCenter = new double[] { -Math.PI/2, Math.PI, 0 };
dt = 0;
xp = 4/Math.sqrt(3)*(x-1);
yp = y+1/3.0;
}
else if (x < 0) {
faceCenter = new double[] { Math.PI/2-Math.asin(Math.sqrt(8)/3), 4*Math.PI/3, 0 };
dt = Math.PI/3;
xp = 4/Math.sqrt(3)*(x+0.5);
yp = y-1/3.0;
}
else {
faceCenter = new double[] { Math.PI/2-Math.asin(Math.sqrt(8)/3), 2*Math.PI/3, 0 };
dt = -Math.PI/3;
xp = 4/Math.sqrt(3)*(x-0.5);
yp = y-1/3.0;
}
return obliquifyPlnr(
innerInverse(Math.hypot(xp, yp), Math.atan2(yp, xp)+dt), faceCenter);
}
protected double[] innerInverse(double r, double tht) {
final double t0 = Math.floor((tht+Math.PI/2)/(2*Math.PI/3)+0.5)*(2*Math.PI/3) - Math.PI/2;
final double dt = tht-t0;
final double z = 2.49*r*Math.cos(dt);
final double g = 0.03575*z*z*z + 0.0219*z*z + 0.4441*z;
return new double[] {
Math.PI/2 - Math.atan(Math.tan(g)/Math.cos(dt)),
Math.PI/2 + t0 + dt };
}
};
/**
* A base for tetrahedral projections