You should use enum (or at least #define) to name constants such as LEFT_LEGS, RIGHT_LEGS,... instead of using number like 0, 1 which decreases the code readability.
for example:
enum LegSides{
LEFT_LEGS = 0,
RIGHT_LEGS = 1
};
or just forget the numbers:
enum LegSides{
LEFT_LEGS,
RIGHT_LEGS
};
then the function:
double leg(double Z, double Y, double X2, int side) {...}
will be:
double leg(double Z, double Y, double X2, LegSides side) {...}
You should use enum (or at least #define) to name constants such as LEFT_LEGS, RIGHT_LEGS,... instead of using number like 0, 1 which decreases the code readability. for example:
or just forget the numbers:
then the function:
will be:
and call it:
further here