Converting Geographic Coordinates into Lambert2008 coordinatesConverting from polar coordinates to rectangular coordinatesConverting latitude and longitude coordinates from CSV using web serviceWorking and calculating with geographic positionsConverting KML/XML to JavascriptGeographic searchUpdating geo coordinatesCompute spherical distance matrix from list of geographical coordinatesFunction to find user's region based on GPS coordinatesConvert geodetic coordinates to geocentric (cartesian)Convert British and Irish National Grid references to or from WGS84 geodetic coordinates
What is "oversubscription" in Networking?
Golf the smallest circle!
My colleague is constantly blaming me for his errors
Are all commands with an optional argument fragile?
How can I deal with extreme temperatures in a hotel room?
I need help with pasta
What's the safest way to inform a new user of their password on an invite-only website?
Company threatening to call my current job after I declined their offer
How Do I Know When I am in Private Mode?
Can SOCPs approximate better than LPs?
Will writing actual numbers instead of writing them with letters affect readership?
13th chords on guitar
Sharing referee/AE report online to point out a grievous error in refereeing
Is is okay to submit a paper from a master's thesis without informing the advisor?
Comment traduire « That screams X »
Handling a player (unintentionally) stealing the spotlight
Why was Mal so quick to drop Bester in favour of Kaylee?
Just graduated with a master’s degree, but I internalised nothing
Are the requirements of a Horn of Valhalla cumulative?
How is this practical and very old scene shot?
What happens to a wizard's magic when they are swallowed by a tarrasque?
Is Cyclic Ether oxidised by periodic acid
How do we separate rules of logic from non-logical constraints?
Who are these Discworld wizards from this picture?
Converting Geographic Coordinates into Lambert2008 coordinates
Converting from polar coordinates to rectangular coordinatesConverting latitude and longitude coordinates from CSV using web serviceWorking and calculating with geographic positionsConverting KML/XML to JavascriptGeographic searchUpdating geo coordinatesCompute spherical distance matrix from list of geographical coordinatesFunction to find user's region based on GPS coordinatesConvert geodetic coordinates to geocentric (cartesian)Convert British and Irish National Grid references to or from WGS84 geodetic coordinates
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
This is part of a game made in Unity3D.
I wrote this class to convert geographic coordinates into lambert 2008 coordinates based on this reference document:
http://www.ngi.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf
Reason is that I'm using a Belgian National Geographic Institute map as background, and want to locate waypoint and player position with full accuracy.
Code works fine, and runs in .000001s but I'm unhappy with its readability.
I start by declaring all the constants I need
public const int a = 6378137;
public const double f = 1 / 298.257222101;
public const double lowerLatitude = 49.8333333 * Mathf.Deg2Rad;
public const double upperLatitude = 51.1666667 * Mathf.Deg2Rad;
public const double originLatitude = 50.797815 * Mathf.Deg2Rad;
public const double originLongitude = 4.359215833 * Mathf.Deg2Rad;
public const int originX = 649328;
public const int originY = 665262;
Then I used properties for all values derived from those constants
public static double Excentricity get => System.Math.Sqrt((2 * f) - (f * f));
static double MLower get => M(lowerLatitude);
static double MUpper get => M(upperLatitude);
static double M(double latitude)
return System.Math.Cos(latitude) / System.Math.Sqrt(1 - (Excentricity * Excentricity * System.Math.Pow(System.Math.Sin(latitude), 2)));
static double TLower get => T(lowerLatitude);
static double TUpper get => T(upperLatitude);
static double TOrigin get => T(originLatitude);
static double T(double latitude)
return System.Math.Tan(Mathf.PI / 4 - latitude / 2) / System.Math.Pow((1 - Excentricity * System.Math.Sin(latitude)) / (1 + Excentricity * System.Math.Sin(latitude)), Excentricity / 2);
static double N get => (System.Math.Log(MLower) - System.Math.Log(MUpper)) / (System.Math.Log(TLower) - System.Math.Log(TUpper));
static double G get => MLower / (N * System.Math.Pow(TLower, N));
static double ROrigin get => R(TOrigin);
static double R (double t)
return a * G * System.Math.Pow(t, N);
As you can see some of the calculations are written on very long lines. I'm unhappy with their readability, but I have no Idea on how to re-write them to make them look better while not messing up floating point approximations.
Finally I perform the actual conversion using all those calculated values.
public static Vector2 FromGeographicRelative(Vector2 coordinates)
double t = T((double)coordinates.x * Mathf.Deg2Rad);
double r = R(t);
double angle = N * ((double)coordinates.y * Mathf.Deg2Rad - originLongitude);
Vector2 lambertCoord = new Vector2
x = (float) (r * System.Math.Sin(angle)),
y = (float) (ROrigin - r * System.Math.Cos(angle))
;
return lambertCoord;
c# geospatial
New contributor
user1747281 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
This is part of a game made in Unity3D.
I wrote this class to convert geographic coordinates into lambert 2008 coordinates based on this reference document:
http://www.ngi.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf
Reason is that I'm using a Belgian National Geographic Institute map as background, and want to locate waypoint and player position with full accuracy.
Code works fine, and runs in .000001s but I'm unhappy with its readability.
I start by declaring all the constants I need
public const int a = 6378137;
public const double f = 1 / 298.257222101;
public const double lowerLatitude = 49.8333333 * Mathf.Deg2Rad;
public const double upperLatitude = 51.1666667 * Mathf.Deg2Rad;
public const double originLatitude = 50.797815 * Mathf.Deg2Rad;
public const double originLongitude = 4.359215833 * Mathf.Deg2Rad;
public const int originX = 649328;
public const int originY = 665262;
Then I used properties for all values derived from those constants
public static double Excentricity get => System.Math.Sqrt((2 * f) - (f * f));
static double MLower get => M(lowerLatitude);
static double MUpper get => M(upperLatitude);
static double M(double latitude)
return System.Math.Cos(latitude) / System.Math.Sqrt(1 - (Excentricity * Excentricity * System.Math.Pow(System.Math.Sin(latitude), 2)));
static double TLower get => T(lowerLatitude);
static double TUpper get => T(upperLatitude);
static double TOrigin get => T(originLatitude);
static double T(double latitude)
return System.Math.Tan(Mathf.PI / 4 - latitude / 2) / System.Math.Pow((1 - Excentricity * System.Math.Sin(latitude)) / (1 + Excentricity * System.Math.Sin(latitude)), Excentricity / 2);
static double N get => (System.Math.Log(MLower) - System.Math.Log(MUpper)) / (System.Math.Log(TLower) - System.Math.Log(TUpper));
static double G get => MLower / (N * System.Math.Pow(TLower, N));
static double ROrigin get => R(TOrigin);
static double R (double t)
return a * G * System.Math.Pow(t, N);
As you can see some of the calculations are written on very long lines. I'm unhappy with their readability, but I have no Idea on how to re-write them to make them look better while not messing up floating point approximations.
Finally I perform the actual conversion using all those calculated values.
public static Vector2 FromGeographicRelative(Vector2 coordinates)
double t = T((double)coordinates.x * Mathf.Deg2Rad);
double r = R(t);
double angle = N * ((double)coordinates.y * Mathf.Deg2Rad - originLongitude);
Vector2 lambertCoord = new Vector2
x = (float) (r * System.Math.Sin(angle)),
y = (float) (ROrigin - r * System.Math.Cos(angle))
;
return lambertCoord;
c# geospatial
New contributor
user1747281 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
This is part of a game made in Unity3D.
I wrote this class to convert geographic coordinates into lambert 2008 coordinates based on this reference document:
http://www.ngi.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf
Reason is that I'm using a Belgian National Geographic Institute map as background, and want to locate waypoint and player position with full accuracy.
Code works fine, and runs in .000001s but I'm unhappy with its readability.
I start by declaring all the constants I need
public const int a = 6378137;
public const double f = 1 / 298.257222101;
public const double lowerLatitude = 49.8333333 * Mathf.Deg2Rad;
public const double upperLatitude = 51.1666667 * Mathf.Deg2Rad;
public const double originLatitude = 50.797815 * Mathf.Deg2Rad;
public const double originLongitude = 4.359215833 * Mathf.Deg2Rad;
public const int originX = 649328;
public const int originY = 665262;
Then I used properties for all values derived from those constants
public static double Excentricity get => System.Math.Sqrt((2 * f) - (f * f));
static double MLower get => M(lowerLatitude);
static double MUpper get => M(upperLatitude);
static double M(double latitude)
return System.Math.Cos(latitude) / System.Math.Sqrt(1 - (Excentricity * Excentricity * System.Math.Pow(System.Math.Sin(latitude), 2)));
static double TLower get => T(lowerLatitude);
static double TUpper get => T(upperLatitude);
static double TOrigin get => T(originLatitude);
static double T(double latitude)
return System.Math.Tan(Mathf.PI / 4 - latitude / 2) / System.Math.Pow((1 - Excentricity * System.Math.Sin(latitude)) / (1 + Excentricity * System.Math.Sin(latitude)), Excentricity / 2);
static double N get => (System.Math.Log(MLower) - System.Math.Log(MUpper)) / (System.Math.Log(TLower) - System.Math.Log(TUpper));
static double G get => MLower / (N * System.Math.Pow(TLower, N));
static double ROrigin get => R(TOrigin);
static double R (double t)
return a * G * System.Math.Pow(t, N);
As you can see some of the calculations are written on very long lines. I'm unhappy with their readability, but I have no Idea on how to re-write them to make them look better while not messing up floating point approximations.
Finally I perform the actual conversion using all those calculated values.
public static Vector2 FromGeographicRelative(Vector2 coordinates)
double t = T((double)coordinates.x * Mathf.Deg2Rad);
double r = R(t);
double angle = N * ((double)coordinates.y * Mathf.Deg2Rad - originLongitude);
Vector2 lambertCoord = new Vector2
x = (float) (r * System.Math.Sin(angle)),
y = (float) (ROrigin - r * System.Math.Cos(angle))
;
return lambertCoord;
c# geospatial
New contributor
user1747281 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
This is part of a game made in Unity3D.
I wrote this class to convert geographic coordinates into lambert 2008 coordinates based on this reference document:
http://www.ngi.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf
Reason is that I'm using a Belgian National Geographic Institute map as background, and want to locate waypoint and player position with full accuracy.
Code works fine, and runs in .000001s but I'm unhappy with its readability.
I start by declaring all the constants I need
public const int a = 6378137;
public const double f = 1 / 298.257222101;
public const double lowerLatitude = 49.8333333 * Mathf.Deg2Rad;
public const double upperLatitude = 51.1666667 * Mathf.Deg2Rad;
public const double originLatitude = 50.797815 * Mathf.Deg2Rad;
public const double originLongitude = 4.359215833 * Mathf.Deg2Rad;
public const int originX = 649328;
public const int originY = 665262;
Then I used properties for all values derived from those constants
public static double Excentricity get => System.Math.Sqrt((2 * f) - (f * f));
static double MLower get => M(lowerLatitude);
static double MUpper get => M(upperLatitude);
static double M(double latitude)
return System.Math.Cos(latitude) / System.Math.Sqrt(1 - (Excentricity * Excentricity * System.Math.Pow(System.Math.Sin(latitude), 2)));
static double TLower get => T(lowerLatitude);
static double TUpper get => T(upperLatitude);
static double TOrigin get => T(originLatitude);
static double T(double latitude)
return System.Math.Tan(Mathf.PI / 4 - latitude / 2) / System.Math.Pow((1 - Excentricity * System.Math.Sin(latitude)) / (1 + Excentricity * System.Math.Sin(latitude)), Excentricity / 2);
static double N get => (System.Math.Log(MLower) - System.Math.Log(MUpper)) / (System.Math.Log(TLower) - System.Math.Log(TUpper));
static double G get => MLower / (N * System.Math.Pow(TLower, N));
static double ROrigin get => R(TOrigin);
static double R (double t)
return a * G * System.Math.Pow(t, N);
As you can see some of the calculations are written on very long lines. I'm unhappy with their readability, but I have no Idea on how to re-write them to make them look better while not messing up floating point approximations.
Finally I perform the actual conversion using all those calculated values.
public static Vector2 FromGeographicRelative(Vector2 coordinates)
double t = T((double)coordinates.x * Mathf.Deg2Rad);
double r = R(t);
double angle = N * ((double)coordinates.y * Mathf.Deg2Rad - originLongitude);
Vector2 lambertCoord = new Vector2
x = (float) (r * System.Math.Sin(angle)),
y = (float) (ROrigin - r * System.Math.Cos(angle))
;
return lambertCoord;
c# geospatial
c# geospatial
New contributor
user1747281 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
user1747281 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 4 hours ago
user1747281
New contributor
user1747281 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 8 hours ago
user1747281user1747281
263 bronze badges
263 bronze badges
New contributor
user1747281 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
user1747281 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
$begingroup$
Since the code is about implementing mathematical formulas I would make an exception and completely ignore the usual naming conventions. Instead, I would use the exact symbols as that document.
This would mean a little bit copy/paste because it's difficult to write symbols like [ϕ, λ, θ] but the compiler can work with unicode.
I find that code like this:
var rad = 0.01745329252;
var ellipsoide = (a: 6378137, f: 1 / 298.257222101);
var ϕ1 = 49.8333333 * rad;
var ϕ2 = 51.1666667 * rad;
var ϕ0 = 50.797815 * rad;
var λ0 = 4.359215833 * rad;
var x0 = 649328;
var y0 = 665262;
is the most easy one to understand because you can compare it with the book almost without any translation.
$endgroup$
$begingroup$
Oh, that's awesome, I didn't know the compiler accepted special characters like this. Thanks a lot.
$endgroup$
– user1747281
3 hours ago
add a comment |
$begingroup$
I think it's a code smell to have more than one (infix) operator in one line.
What would be the recommended way of doing this, both for readability and performance?
Yes! But please use good names.
For performance it doesn't matter. The C# compiler will probably inline those things so it's the same generated IL code
Related:
"Expressions should not be too complex"
https://rules.sonarsource.com/csharp/RSPEC-1067?search=operator
Noncompliant Code Example
With the default threshold value of 3if (((condition1 && condition2) || (condition3 && condition4)) && condition5) ...
Compliant Solution
if ((MyFirstCondition() || MySecondCondition()) && MyLastCondition()) ...
New contributor
Julian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
$begingroup$
I would love to use good names, but I just have no idea what to name things. Here's the reference document for the formulas, good luck with coming up with nice names: ngi.be/Common/Lambert2008/…
$endgroup$
– user1747281
8 hours ago
$begingroup$
What is a good name for mathematical functions and operands? I rather likef(a, b)thenanyfunction(firstOperandOfAnyFunction, secondOperandOfAnyFunction)
$endgroup$
– dfhwze
5 hours ago
add a comment |
$begingroup$
- In math heavy code you might use the
using staticdirective, see the microsoft documentation such thatSystem.Math.can be removed throughout the code. Excentricitycan be made a constant and may have a shorter name as I have seen in other codes dealing with WGS84.- If possible refer to a document and formula number in a comment
- Although sometime frowned on, I like to layout the the code as much as possible as the mathematical equation looks like. (use extra parentheses if it improves readability)
With this in mind I came to to following example for method T.
using static System.Math;
public const double E2 = (2 * f) - (f * f); # Excentricity squared
public const double E1 = Sqrt(E2); # Excentricity
.....
static double T(double lat)
// if possible refer to a document and formula number
return Tan(PI / 4 - lat / 2)
/
Pow( ((1 - E1 * Sin(lat))
/
(1 + E1 * Sin(lat))) , E1 / 2);
$endgroup$
$begingroup$
Thanks, a lot for these hints. I'm deliberately not using "using System.Math" because this code is part of a game made with Unity3D. Typically, Unity programmers would use UnityEngine.Mathf, which is a wrapper class for System.Math using floats instead of doubles (because game engines like floats better). So to make it more obvious I explicitly prefix my math calls with System.Math (perhaps a bad practice, would be happy to have your opinion on this) Thanks for the excentricity tip, will definitely do that.
$endgroup$
– user1747281
6 hours ago
$begingroup$
You can add a using directive:using Math = System.Math
$endgroup$
– dfhwze
5 hours ago
$begingroup$
@user1747281 I am not familiar with Unity programmers conventions, butusing static UnityEngine.Mathfmight be acceptable, also when using Mathf the constants can be made floats instead of doubles.
$endgroup$
– Jan Kuiken
5 hours ago
1
$begingroup$
@user1747281 that this code is part of a game made with Unity3D should have been mentioned in the question so that reviewers have enough context how it is used.
$endgroup$
– t3chb0t
5 hours ago
$begingroup$
@t3chb0t done, thanks for pointing that out
$endgroup$
– user1747281
4 hours ago
add a comment |
$begingroup$
Naming Conventions
Some, but not all of your variables and functions are named after mathematical usage. I like it either way, but a combination is an inconsistent naming convention.
public const double f = 1 / 298.257222101;
public const double lowerLatitude = 49.8333333 * Mathf.Deg2Rad;
Constants
You have a lot of mathematical constants that aren't constants in your API. Why?
Excentricity, MLower, MUpper, TLower, TUpper, TOrigin, ROrigin, N, G.
Aliases
You are using both System.Math and UnityEngine.Mathf. To avoid repeating code I suggest to import the one you used most as a static using and the other as an aliased using.
using static UnityEngine.Mathf;
using Math = System.Math;
$endgroup$
$begingroup$
Naming conventions: I didn't know you could use mathematical symbols in names, so instead of naming the variable "phi1", "phi2" etc... I opted for a purposeful name. But I now know better thanks to this community :-) Constants: I don't understand what you mean. They're not constants, they're derived from constants. I tried this:public const double Excentricity = System.Math.Sqrt((2 * f) - (f * f));but the compiler doesn't accept it because Sqrt((2 * f)-(f*f)) is not a constant. Aliases: I like that idea, thanks for the tip
$endgroup$
– user1747281
2 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "196"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
user1747281 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f222988%2fconverting-geographic-coordinates-into-lambert2008-coordinates%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Since the code is about implementing mathematical formulas I would make an exception and completely ignore the usual naming conventions. Instead, I would use the exact symbols as that document.
This would mean a little bit copy/paste because it's difficult to write symbols like [ϕ, λ, θ] but the compiler can work with unicode.
I find that code like this:
var rad = 0.01745329252;
var ellipsoide = (a: 6378137, f: 1 / 298.257222101);
var ϕ1 = 49.8333333 * rad;
var ϕ2 = 51.1666667 * rad;
var ϕ0 = 50.797815 * rad;
var λ0 = 4.359215833 * rad;
var x0 = 649328;
var y0 = 665262;
is the most easy one to understand because you can compare it with the book almost without any translation.
$endgroup$
$begingroup$
Oh, that's awesome, I didn't know the compiler accepted special characters like this. Thanks a lot.
$endgroup$
– user1747281
3 hours ago
add a comment |
$begingroup$
Since the code is about implementing mathematical formulas I would make an exception and completely ignore the usual naming conventions. Instead, I would use the exact symbols as that document.
This would mean a little bit copy/paste because it's difficult to write symbols like [ϕ, λ, θ] but the compiler can work with unicode.
I find that code like this:
var rad = 0.01745329252;
var ellipsoide = (a: 6378137, f: 1 / 298.257222101);
var ϕ1 = 49.8333333 * rad;
var ϕ2 = 51.1666667 * rad;
var ϕ0 = 50.797815 * rad;
var λ0 = 4.359215833 * rad;
var x0 = 649328;
var y0 = 665262;
is the most easy one to understand because you can compare it with the book almost without any translation.
$endgroup$
$begingroup$
Oh, that's awesome, I didn't know the compiler accepted special characters like this. Thanks a lot.
$endgroup$
– user1747281
3 hours ago
add a comment |
$begingroup$
Since the code is about implementing mathematical formulas I would make an exception and completely ignore the usual naming conventions. Instead, I would use the exact symbols as that document.
This would mean a little bit copy/paste because it's difficult to write symbols like [ϕ, λ, θ] but the compiler can work with unicode.
I find that code like this:
var rad = 0.01745329252;
var ellipsoide = (a: 6378137, f: 1 / 298.257222101);
var ϕ1 = 49.8333333 * rad;
var ϕ2 = 51.1666667 * rad;
var ϕ0 = 50.797815 * rad;
var λ0 = 4.359215833 * rad;
var x0 = 649328;
var y0 = 665262;
is the most easy one to understand because you can compare it with the book almost without any translation.
$endgroup$
Since the code is about implementing mathematical formulas I would make an exception and completely ignore the usual naming conventions. Instead, I would use the exact symbols as that document.
This would mean a little bit copy/paste because it's difficult to write symbols like [ϕ, λ, θ] but the compiler can work with unicode.
I find that code like this:
var rad = 0.01745329252;
var ellipsoide = (a: 6378137, f: 1 / 298.257222101);
var ϕ1 = 49.8333333 * rad;
var ϕ2 = 51.1666667 * rad;
var ϕ0 = 50.797815 * rad;
var λ0 = 4.359215833 * rad;
var x0 = 649328;
var y0 = 665262;
is the most easy one to understand because you can compare it with the book almost without any translation.
edited 3 hours ago
dfhwze
3,6161 gold badge6 silver badges32 bronze badges
3,6161 gold badge6 silver badges32 bronze badges
answered 3 hours ago
t3chb0tt3chb0t
36.1k7 gold badges58 silver badges133 bronze badges
36.1k7 gold badges58 silver badges133 bronze badges
$begingroup$
Oh, that's awesome, I didn't know the compiler accepted special characters like this. Thanks a lot.
$endgroup$
– user1747281
3 hours ago
add a comment |
$begingroup$
Oh, that's awesome, I didn't know the compiler accepted special characters like this. Thanks a lot.
$endgroup$
– user1747281
3 hours ago
$begingroup$
Oh, that's awesome, I didn't know the compiler accepted special characters like this. Thanks a lot.
$endgroup$
– user1747281
3 hours ago
$begingroup$
Oh, that's awesome, I didn't know the compiler accepted special characters like this. Thanks a lot.
$endgroup$
– user1747281
3 hours ago
add a comment |
$begingroup$
I think it's a code smell to have more than one (infix) operator in one line.
What would be the recommended way of doing this, both for readability and performance?
Yes! But please use good names.
For performance it doesn't matter. The C# compiler will probably inline those things so it's the same generated IL code
Related:
"Expressions should not be too complex"
https://rules.sonarsource.com/csharp/RSPEC-1067?search=operator
Noncompliant Code Example
With the default threshold value of 3if (((condition1 && condition2) || (condition3 && condition4)) && condition5) ...
Compliant Solution
if ((MyFirstCondition() || MySecondCondition()) && MyLastCondition()) ...
New contributor
Julian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
$begingroup$
I would love to use good names, but I just have no idea what to name things. Here's the reference document for the formulas, good luck with coming up with nice names: ngi.be/Common/Lambert2008/…
$endgroup$
– user1747281
8 hours ago
$begingroup$
What is a good name for mathematical functions and operands? I rather likef(a, b)thenanyfunction(firstOperandOfAnyFunction, secondOperandOfAnyFunction)
$endgroup$
– dfhwze
5 hours ago
add a comment |
$begingroup$
I think it's a code smell to have more than one (infix) operator in one line.
What would be the recommended way of doing this, both for readability and performance?
Yes! But please use good names.
For performance it doesn't matter. The C# compiler will probably inline those things so it's the same generated IL code
Related:
"Expressions should not be too complex"
https://rules.sonarsource.com/csharp/RSPEC-1067?search=operator
Noncompliant Code Example
With the default threshold value of 3if (((condition1 && condition2) || (condition3 && condition4)) && condition5) ...
Compliant Solution
if ((MyFirstCondition() || MySecondCondition()) && MyLastCondition()) ...
New contributor
Julian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
$begingroup$
I would love to use good names, but I just have no idea what to name things. Here's the reference document for the formulas, good luck with coming up with nice names: ngi.be/Common/Lambert2008/…
$endgroup$
– user1747281
8 hours ago
$begingroup$
What is a good name for mathematical functions and operands? I rather likef(a, b)thenanyfunction(firstOperandOfAnyFunction, secondOperandOfAnyFunction)
$endgroup$
– dfhwze
5 hours ago
add a comment |
$begingroup$
I think it's a code smell to have more than one (infix) operator in one line.
What would be the recommended way of doing this, both for readability and performance?
Yes! But please use good names.
For performance it doesn't matter. The C# compiler will probably inline those things so it's the same generated IL code
Related:
"Expressions should not be too complex"
https://rules.sonarsource.com/csharp/RSPEC-1067?search=operator
Noncompliant Code Example
With the default threshold value of 3if (((condition1 && condition2) || (condition3 && condition4)) && condition5) ...
Compliant Solution
if ((MyFirstCondition() || MySecondCondition()) && MyLastCondition()) ...
New contributor
Julian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I think it's a code smell to have more than one (infix) operator in one line.
What would be the recommended way of doing this, both for readability and performance?
Yes! But please use good names.
For performance it doesn't matter. The C# compiler will probably inline those things so it's the same generated IL code
Related:
"Expressions should not be too complex"
https://rules.sonarsource.com/csharp/RSPEC-1067?search=operator
Noncompliant Code Example
With the default threshold value of 3if (((condition1 && condition2) || (condition3 && condition4)) && condition5) ...
Compliant Solution
if ((MyFirstCondition() || MySecondCondition()) && MyLastCondition()) ...
New contributor
Julian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Julian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 8 hours ago
JulianJulian
1293 bronze badges
1293 bronze badges
New contributor
Julian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Julian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$begingroup$
I would love to use good names, but I just have no idea what to name things. Here's the reference document for the formulas, good luck with coming up with nice names: ngi.be/Common/Lambert2008/…
$endgroup$
– user1747281
8 hours ago
$begingroup$
What is a good name for mathematical functions and operands? I rather likef(a, b)thenanyfunction(firstOperandOfAnyFunction, secondOperandOfAnyFunction)
$endgroup$
– dfhwze
5 hours ago
add a comment |
$begingroup$
I would love to use good names, but I just have no idea what to name things. Here's the reference document for the formulas, good luck with coming up with nice names: ngi.be/Common/Lambert2008/…
$endgroup$
– user1747281
8 hours ago
$begingroup$
What is a good name for mathematical functions and operands? I rather likef(a, b)thenanyfunction(firstOperandOfAnyFunction, secondOperandOfAnyFunction)
$endgroup$
– dfhwze
5 hours ago
$begingroup$
I would love to use good names, but I just have no idea what to name things. Here's the reference document for the formulas, good luck with coming up with nice names: ngi.be/Common/Lambert2008/…
$endgroup$
– user1747281
8 hours ago
$begingroup$
I would love to use good names, but I just have no idea what to name things. Here's the reference document for the formulas, good luck with coming up with nice names: ngi.be/Common/Lambert2008/…
$endgroup$
– user1747281
8 hours ago
$begingroup$
What is a good name for mathematical functions and operands? I rather like
f(a, b) then anyfunction(firstOperandOfAnyFunction, secondOperandOfAnyFunction)$endgroup$
– dfhwze
5 hours ago
$begingroup$
What is a good name for mathematical functions and operands? I rather like
f(a, b) then anyfunction(firstOperandOfAnyFunction, secondOperandOfAnyFunction)$endgroup$
– dfhwze
5 hours ago
add a comment |
$begingroup$
- In math heavy code you might use the
using staticdirective, see the microsoft documentation such thatSystem.Math.can be removed throughout the code. Excentricitycan be made a constant and may have a shorter name as I have seen in other codes dealing with WGS84.- If possible refer to a document and formula number in a comment
- Although sometime frowned on, I like to layout the the code as much as possible as the mathematical equation looks like. (use extra parentheses if it improves readability)
With this in mind I came to to following example for method T.
using static System.Math;
public const double E2 = (2 * f) - (f * f); # Excentricity squared
public const double E1 = Sqrt(E2); # Excentricity
.....
static double T(double lat)
// if possible refer to a document and formula number
return Tan(PI / 4 - lat / 2)
/
Pow( ((1 - E1 * Sin(lat))
/
(1 + E1 * Sin(lat))) , E1 / 2);
$endgroup$
$begingroup$
Thanks, a lot for these hints. I'm deliberately not using "using System.Math" because this code is part of a game made with Unity3D. Typically, Unity programmers would use UnityEngine.Mathf, which is a wrapper class for System.Math using floats instead of doubles (because game engines like floats better). So to make it more obvious I explicitly prefix my math calls with System.Math (perhaps a bad practice, would be happy to have your opinion on this) Thanks for the excentricity tip, will definitely do that.
$endgroup$
– user1747281
6 hours ago
$begingroup$
You can add a using directive:using Math = System.Math
$endgroup$
– dfhwze
5 hours ago
$begingroup$
@user1747281 I am not familiar with Unity programmers conventions, butusing static UnityEngine.Mathfmight be acceptable, also when using Mathf the constants can be made floats instead of doubles.
$endgroup$
– Jan Kuiken
5 hours ago
1
$begingroup$
@user1747281 that this code is part of a game made with Unity3D should have been mentioned in the question so that reviewers have enough context how it is used.
$endgroup$
– t3chb0t
5 hours ago
$begingroup$
@t3chb0t done, thanks for pointing that out
$endgroup$
– user1747281
4 hours ago
add a comment |
$begingroup$
- In math heavy code you might use the
using staticdirective, see the microsoft documentation such thatSystem.Math.can be removed throughout the code. Excentricitycan be made a constant and may have a shorter name as I have seen in other codes dealing with WGS84.- If possible refer to a document and formula number in a comment
- Although sometime frowned on, I like to layout the the code as much as possible as the mathematical equation looks like. (use extra parentheses if it improves readability)
With this in mind I came to to following example for method T.
using static System.Math;
public const double E2 = (2 * f) - (f * f); # Excentricity squared
public const double E1 = Sqrt(E2); # Excentricity
.....
static double T(double lat)
// if possible refer to a document and formula number
return Tan(PI / 4 - lat / 2)
/
Pow( ((1 - E1 * Sin(lat))
/
(1 + E1 * Sin(lat))) , E1 / 2);
$endgroup$
$begingroup$
Thanks, a lot for these hints. I'm deliberately not using "using System.Math" because this code is part of a game made with Unity3D. Typically, Unity programmers would use UnityEngine.Mathf, which is a wrapper class for System.Math using floats instead of doubles (because game engines like floats better). So to make it more obvious I explicitly prefix my math calls with System.Math (perhaps a bad practice, would be happy to have your opinion on this) Thanks for the excentricity tip, will definitely do that.
$endgroup$
– user1747281
6 hours ago
$begingroup$
You can add a using directive:using Math = System.Math
$endgroup$
– dfhwze
5 hours ago
$begingroup$
@user1747281 I am not familiar with Unity programmers conventions, butusing static UnityEngine.Mathfmight be acceptable, also when using Mathf the constants can be made floats instead of doubles.
$endgroup$
– Jan Kuiken
5 hours ago
1
$begingroup$
@user1747281 that this code is part of a game made with Unity3D should have been mentioned in the question so that reviewers have enough context how it is used.
$endgroup$
– t3chb0t
5 hours ago
$begingroup$
@t3chb0t done, thanks for pointing that out
$endgroup$
– user1747281
4 hours ago
add a comment |
$begingroup$
- In math heavy code you might use the
using staticdirective, see the microsoft documentation such thatSystem.Math.can be removed throughout the code. Excentricitycan be made a constant and may have a shorter name as I have seen in other codes dealing with WGS84.- If possible refer to a document and formula number in a comment
- Although sometime frowned on, I like to layout the the code as much as possible as the mathematical equation looks like. (use extra parentheses if it improves readability)
With this in mind I came to to following example for method T.
using static System.Math;
public const double E2 = (2 * f) - (f * f); # Excentricity squared
public const double E1 = Sqrt(E2); # Excentricity
.....
static double T(double lat)
// if possible refer to a document and formula number
return Tan(PI / 4 - lat / 2)
/
Pow( ((1 - E1 * Sin(lat))
/
(1 + E1 * Sin(lat))) , E1 / 2);
$endgroup$
- In math heavy code you might use the
using staticdirective, see the microsoft documentation such thatSystem.Math.can be removed throughout the code. Excentricitycan be made a constant and may have a shorter name as I have seen in other codes dealing with WGS84.- If possible refer to a document and formula number in a comment
- Although sometime frowned on, I like to layout the the code as much as possible as the mathematical equation looks like. (use extra parentheses if it improves readability)
With this in mind I came to to following example for method T.
using static System.Math;
public const double E2 = (2 * f) - (f * f); # Excentricity squared
public const double E1 = Sqrt(E2); # Excentricity
.....
static double T(double lat)
// if possible refer to a document and formula number
return Tan(PI / 4 - lat / 2)
/
Pow( ((1 - E1 * Sin(lat))
/
(1 + E1 * Sin(lat))) , E1 / 2);
edited 4 hours ago
answered 6 hours ago
Jan KuikenJan Kuiken
8884 silver badges8 bronze badges
8884 silver badges8 bronze badges
$begingroup$
Thanks, a lot for these hints. I'm deliberately not using "using System.Math" because this code is part of a game made with Unity3D. Typically, Unity programmers would use UnityEngine.Mathf, which is a wrapper class for System.Math using floats instead of doubles (because game engines like floats better). So to make it more obvious I explicitly prefix my math calls with System.Math (perhaps a bad practice, would be happy to have your opinion on this) Thanks for the excentricity tip, will definitely do that.
$endgroup$
– user1747281
6 hours ago
$begingroup$
You can add a using directive:using Math = System.Math
$endgroup$
– dfhwze
5 hours ago
$begingroup$
@user1747281 I am not familiar with Unity programmers conventions, butusing static UnityEngine.Mathfmight be acceptable, also when using Mathf the constants can be made floats instead of doubles.
$endgroup$
– Jan Kuiken
5 hours ago
1
$begingroup$
@user1747281 that this code is part of a game made with Unity3D should have been mentioned in the question so that reviewers have enough context how it is used.
$endgroup$
– t3chb0t
5 hours ago
$begingroup$
@t3chb0t done, thanks for pointing that out
$endgroup$
– user1747281
4 hours ago
add a comment |
$begingroup$
Thanks, a lot for these hints. I'm deliberately not using "using System.Math" because this code is part of a game made with Unity3D. Typically, Unity programmers would use UnityEngine.Mathf, which is a wrapper class for System.Math using floats instead of doubles (because game engines like floats better). So to make it more obvious I explicitly prefix my math calls with System.Math (perhaps a bad practice, would be happy to have your opinion on this) Thanks for the excentricity tip, will definitely do that.
$endgroup$
– user1747281
6 hours ago
$begingroup$
You can add a using directive:using Math = System.Math
$endgroup$
– dfhwze
5 hours ago
$begingroup$
@user1747281 I am not familiar with Unity programmers conventions, butusing static UnityEngine.Mathfmight be acceptable, also when using Mathf the constants can be made floats instead of doubles.
$endgroup$
– Jan Kuiken
5 hours ago
1
$begingroup$
@user1747281 that this code is part of a game made with Unity3D should have been mentioned in the question so that reviewers have enough context how it is used.
$endgroup$
– t3chb0t
5 hours ago
$begingroup$
@t3chb0t done, thanks for pointing that out
$endgroup$
– user1747281
4 hours ago
$begingroup$
Thanks, a lot for these hints. I'm deliberately not using "using System.Math" because this code is part of a game made with Unity3D. Typically, Unity programmers would use UnityEngine.Mathf, which is a wrapper class for System.Math using floats instead of doubles (because game engines like floats better). So to make it more obvious I explicitly prefix my math calls with System.Math (perhaps a bad practice, would be happy to have your opinion on this) Thanks for the excentricity tip, will definitely do that.
$endgroup$
– user1747281
6 hours ago
$begingroup$
Thanks, a lot for these hints. I'm deliberately not using "using System.Math" because this code is part of a game made with Unity3D. Typically, Unity programmers would use UnityEngine.Mathf, which is a wrapper class for System.Math using floats instead of doubles (because game engines like floats better). So to make it more obvious I explicitly prefix my math calls with System.Math (perhaps a bad practice, would be happy to have your opinion on this) Thanks for the excentricity tip, will definitely do that.
$endgroup$
– user1747281
6 hours ago
$begingroup$
You can add a using directive:
using Math = System.Math$endgroup$
– dfhwze
5 hours ago
$begingroup$
You can add a using directive:
using Math = System.Math$endgroup$
– dfhwze
5 hours ago
$begingroup$
@user1747281 I am not familiar with Unity programmers conventions, but
using static UnityEngine.Mathf might be acceptable, also when using Mathf the constants can be made floats instead of doubles.$endgroup$
– Jan Kuiken
5 hours ago
$begingroup$
@user1747281 I am not familiar with Unity programmers conventions, but
using static UnityEngine.Mathf might be acceptable, also when using Mathf the constants can be made floats instead of doubles.$endgroup$
– Jan Kuiken
5 hours ago
1
1
$begingroup$
@user1747281 that this code is part of a game made with Unity3D should have been mentioned in the question so that reviewers have enough context how it is used.
$endgroup$
– t3chb0t
5 hours ago
$begingroup$
@user1747281 that this code is part of a game made with Unity3D should have been mentioned in the question so that reviewers have enough context how it is used.
$endgroup$
– t3chb0t
5 hours ago
$begingroup$
@t3chb0t done, thanks for pointing that out
$endgroup$
– user1747281
4 hours ago
$begingroup$
@t3chb0t done, thanks for pointing that out
$endgroup$
– user1747281
4 hours ago
add a comment |
$begingroup$
Naming Conventions
Some, but not all of your variables and functions are named after mathematical usage. I like it either way, but a combination is an inconsistent naming convention.
public const double f = 1 / 298.257222101;
public const double lowerLatitude = 49.8333333 * Mathf.Deg2Rad;
Constants
You have a lot of mathematical constants that aren't constants in your API. Why?
Excentricity, MLower, MUpper, TLower, TUpper, TOrigin, ROrigin, N, G.
Aliases
You are using both System.Math and UnityEngine.Mathf. To avoid repeating code I suggest to import the one you used most as a static using and the other as an aliased using.
using static UnityEngine.Mathf;
using Math = System.Math;
$endgroup$
$begingroup$
Naming conventions: I didn't know you could use mathematical symbols in names, so instead of naming the variable "phi1", "phi2" etc... I opted for a purposeful name. But I now know better thanks to this community :-) Constants: I don't understand what you mean. They're not constants, they're derived from constants. I tried this:public const double Excentricity = System.Math.Sqrt((2 * f) - (f * f));but the compiler doesn't accept it because Sqrt((2 * f)-(f*f)) is not a constant. Aliases: I like that idea, thanks for the tip
$endgroup$
– user1747281
2 hours ago
add a comment |
$begingroup$
Naming Conventions
Some, but not all of your variables and functions are named after mathematical usage. I like it either way, but a combination is an inconsistent naming convention.
public const double f = 1 / 298.257222101;
public const double lowerLatitude = 49.8333333 * Mathf.Deg2Rad;
Constants
You have a lot of mathematical constants that aren't constants in your API. Why?
Excentricity, MLower, MUpper, TLower, TUpper, TOrigin, ROrigin, N, G.
Aliases
You are using both System.Math and UnityEngine.Mathf. To avoid repeating code I suggest to import the one you used most as a static using and the other as an aliased using.
using static UnityEngine.Mathf;
using Math = System.Math;
$endgroup$
$begingroup$
Naming conventions: I didn't know you could use mathematical symbols in names, so instead of naming the variable "phi1", "phi2" etc... I opted for a purposeful name. But I now know better thanks to this community :-) Constants: I don't understand what you mean. They're not constants, they're derived from constants. I tried this:public const double Excentricity = System.Math.Sqrt((2 * f) - (f * f));but the compiler doesn't accept it because Sqrt((2 * f)-(f*f)) is not a constant. Aliases: I like that idea, thanks for the tip
$endgroup$
– user1747281
2 hours ago
add a comment |
$begingroup$
Naming Conventions
Some, but not all of your variables and functions are named after mathematical usage. I like it either way, but a combination is an inconsistent naming convention.
public const double f = 1 / 298.257222101;
public const double lowerLatitude = 49.8333333 * Mathf.Deg2Rad;
Constants
You have a lot of mathematical constants that aren't constants in your API. Why?
Excentricity, MLower, MUpper, TLower, TUpper, TOrigin, ROrigin, N, G.
Aliases
You are using both System.Math and UnityEngine.Mathf. To avoid repeating code I suggest to import the one you used most as a static using and the other as an aliased using.
using static UnityEngine.Mathf;
using Math = System.Math;
$endgroup$
Naming Conventions
Some, but not all of your variables and functions are named after mathematical usage. I like it either way, but a combination is an inconsistent naming convention.
public const double f = 1 / 298.257222101;
public const double lowerLatitude = 49.8333333 * Mathf.Deg2Rad;
Constants
You have a lot of mathematical constants that aren't constants in your API. Why?
Excentricity, MLower, MUpper, TLower, TUpper, TOrigin, ROrigin, N, G.
Aliases
You are using both System.Math and UnityEngine.Mathf. To avoid repeating code I suggest to import the one you used most as a static using and the other as an aliased using.
using static UnityEngine.Mathf;
using Math = System.Math;
answered 4 hours ago
dfhwzedfhwze
3,6161 gold badge6 silver badges32 bronze badges
3,6161 gold badge6 silver badges32 bronze badges
$begingroup$
Naming conventions: I didn't know you could use mathematical symbols in names, so instead of naming the variable "phi1", "phi2" etc... I opted for a purposeful name. But I now know better thanks to this community :-) Constants: I don't understand what you mean. They're not constants, they're derived from constants. I tried this:public const double Excentricity = System.Math.Sqrt((2 * f) - (f * f));but the compiler doesn't accept it because Sqrt((2 * f)-(f*f)) is not a constant. Aliases: I like that idea, thanks for the tip
$endgroup$
– user1747281
2 hours ago
add a comment |
$begingroup$
Naming conventions: I didn't know you could use mathematical symbols in names, so instead of naming the variable "phi1", "phi2" etc... I opted for a purposeful name. But I now know better thanks to this community :-) Constants: I don't understand what you mean. They're not constants, they're derived from constants. I tried this:public const double Excentricity = System.Math.Sqrt((2 * f) - (f * f));but the compiler doesn't accept it because Sqrt((2 * f)-(f*f)) is not a constant. Aliases: I like that idea, thanks for the tip
$endgroup$
– user1747281
2 hours ago
$begingroup$
Naming conventions: I didn't know you could use mathematical symbols in names, so instead of naming the variable "phi1", "phi2" etc... I opted for a purposeful name. But I now know better thanks to this community :-) Constants: I don't understand what you mean. They're not constants, they're derived from constants. I tried this:
public const double Excentricity = System.Math.Sqrt((2 * f) - (f * f)); but the compiler doesn't accept it because Sqrt((2 * f)-(f*f)) is not a constant. Aliases: I like that idea, thanks for the tip$endgroup$
– user1747281
2 hours ago
$begingroup$
Naming conventions: I didn't know you could use mathematical symbols in names, so instead of naming the variable "phi1", "phi2" etc... I opted for a purposeful name. But I now know better thanks to this community :-) Constants: I don't understand what you mean. They're not constants, they're derived from constants. I tried this:
public const double Excentricity = System.Math.Sqrt((2 * f) - (f * f)); but the compiler doesn't accept it because Sqrt((2 * f)-(f*f)) is not a constant. Aliases: I like that idea, thanks for the tip$endgroup$
– user1747281
2 hours ago
add a comment |
user1747281 is a new contributor. Be nice, and check out our Code of Conduct.
user1747281 is a new contributor. Be nice, and check out our Code of Conduct.
user1747281 is a new contributor. Be nice, and check out our Code of Conduct.
user1747281 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f222988%2fconverting-geographic-coordinates-into-lambert2008-coordinates%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown