SMC_SolveSinCos (FUN)

 

FUNCTION SMC_SolveSinCos : BOOL

Solves the following equation for alpha:

a * cos(alpha) + b * sin(alpha) + c = 0.

Precondition: (a,b) <> (0,0), |c| <= sqrt(a²+b²). Returns FALSE if (and only if) the precondition does not hold.

InOut:

Scope

Name

Type

Comment

Return

SMC_SolveSinCos

BOOL

Input

da

LREAL

The factors of the equation

db

LREAL

The factors of the equation

dc

LREAL

The factors of the equation

Output

dAlpha1

LREAL

The first (smaller) solution in radian

dAlpha2

LREAL

The second (larger) solution in radian