GEOarcTan

Top  Previous  Next

Calculation of the gradient of a line.

With this function becomes the gradient of a line which begins in the point (x1, y1) and ends in the point (x2, y2), calculates. The information of the gradient occurs in the curve measure. Both points are allowed not be identical.

Parametre

x1 (stands in) [IN]

y1 (stands in) [IN]

Starting point of the line

x2 (stands in) [IN]

y2 (stands in) [IN]

Terminator point of the line

grad (stands in *) [(IN) / OUT]

Calculated gradient. The information is in curve measure, i.e. 2π if is a full circle.

Result

int OUT

0 OK : Gradient calculates.

1 mistake: Points are identical. Gradient does not calculate.

Declaration

#include "basic.h"

 

stand in for DLLENTRY GEOarcTan (

stand in x1,

stand in y1,

stand in x2,

stand in y2,

stand in * grad

);

Example

status = GEOarcTan (100.0, 100.0, 300.0, 200.0, &grad)

The variable status receives the value 0, i.e. the calculation was carried out. The gradient (grad ) has the value 0.52 (p/6 = 30* ).

status = GEOarcTan (100.0, 100.0, 100.0, 100.0, &grad)

The variable status receives the value 1, i.e. the calculation could not be carried out, because both points are identical.