sds_angtof

double sds_angtof (const char *sangle, int format, double *rangle);


Change this angle to a real number.


This function converts a string, expressing an angle in one of the formats described below, to a real number expressing the angle in radians. The argument *sangle represents the given angle, in the chosen format. The argument format represents the type of string from which sds_angtof will convert the given number.

The following formats are available:

Format Description Example
format=0; Degrees 360d
format=1; Deg/Min/Sec 47d29'15"
format=2; Grads 132g
format=3; Radians 6.28r
format=4; Surveyor's Units N 82d W

The last argument, *rangle, represents the angle, expressed in radians.

This function returns RTNORM or an error code.

Example

int format=0;

sds_real real1;

char string1[512];

sds_getstring(0,"\nEnter an angle in decimal degrees (eg. 47.5): ",string1);

sds_angtof(string1,format,&real1);

sds_printf("\nThat's equal to %f radians. ",real1);

Prints:

Enter an angle in decimal degrees (eg. 47.5): 90

That's equal to 1.5708 radians.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_angle

sds_angtos

sds_getangle

sds_rtos