Once in a while I need to implement more or less complex math formulas in various programming languages. To ensure that some time later I'm still able to read and understand my code, I strive to give my variables meaningful names.
Sometimes, the term 1 - x
is precalculated and stored in a variable but to this day I have not come up with a good name for that variable. Therefore, my question is, does this term have a name in mathematics?
To be more specific, let me make an example. Let's say the formula I implement uses both the terms sin(angle)
and 1 - sin(angle)
multiple times. In that case I would write it as follows:
float sinus = sin(angle);
float whatever = 1 - sinus;
// formula with multiple uses of 'sinus' and whatever
What would be a mathematically understandable name for whatever
?
And yes, I know that whatever
is just a variable that can be named arbitrarily and many will say it doesn't matter much. But I'm curious if there is a descriptive name given by mathematics.
oneminusx
? – GEdgar Jun 16 '23 at 15:34whatever
" is the "coversine", though essentially no one uses that term today. – Mark S. Jun 16 '23 at 20:25