1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

conformal formula accepts ux, uy, uz

This commit is contained in:
Zeno Rogue 2018-11-07 07:21:42 +01:00
parent 3f8d17aa0d
commit 9cff432cee
2 changed files with 4 additions and 1 deletions

View File

@ -630,7 +630,7 @@ namespace conformal {
XLAT( XLAT(
"This lets you specify the projection as a formula f. " "This lets you specify the projection as a formula f. "
"The formula has access to the value 'z', which is a complex number corresponding to the x,y coordinates in the currently selected model; " "The formula has access to the value 'z', which is a complex number corresponding to the x,y coordinates in the currently selected model; "
"the point z is mapped to f(z). For 3D models (or 2D models if you prefer) you can also use parameters cx, cy, cz." "the point z is mapped to f(z). You can also use the underlying coordinates ux, uy, uz."
) + "\n\n" + parser_help() ) + "\n\n" + parser_help()
); );
dialog::reaction_final = [] () { dialog::reaction_final = [] () {

View File

@ -545,6 +545,9 @@ void applymodel(hyperpoint H, hyperpoint& ret) {
ep.extra_params["cx"] = ret[0]; ep.extra_params["cx"] = ret[0];
ep.extra_params["cy"] = ret[1]; ep.extra_params["cy"] = ret[1];
ep.extra_params["cz"] = ret[2]; ep.extra_params["cz"] = ret[2];
ep.extra_params["ux"] = H[0];
ep.extra_params["uy"] = H[1];
ep.extra_params["uz"] = H[2];
ep.s = conformal::formula; ep.s = conformal::formula;
cld res = ep.parse(); cld res = ep.parse();
ret[0] = real(res); ret[0] = real(res);