This chapter introduces the various calculation library functions supported by SGL.
Figure 11-1 Trigonometric function image
Figure 11-2 “slAtan” image
┌─● Vector inner product return value ●───┐ │A(X1,Y1,Z1)*B(X2,Y2,Z2)=X1*X2+Y1*Y2+Z1*Z2│ │ =Return Value │ └─────────────────────────────────────────┘
decimal number | B.C.D. | hexadecimal number | |
---|---|---|---|
Notation | 92 | 0x92 | 0x5CH |
functional type | Function name | Parameter | function |
---|---|---|---|
FIXED | slDivFX | FIXED a,FIXED b | Division (a/b) |
FIXED | slMulFX | FIXED a,FIXED b | Multiplication (a*b) |
FIXED | slSquartFX | FIXED sqrtfx | Unsigned fixed-point square root |
Uint32 | slSquart | Uint32 sqrt | square root of unsigned integer |
FIXED | slSin | ANGLE angs | Returns the sine value for the specified angle |
FIXED | slCos | ANGLE angc | Returns the cosine value for the specified angle |
FIXED | slTan | ANGLE angt | Returns the tangent value for the specified angle |
ANGLE | slAtan | FIXED tx,FIXED ty | returns the angle in the specified direction |
FIXED | slCalcPoint | FIXED zx,cy,cz,FIXED *ret | Multiplies the current matrix by the specified point and returns it. |
FIXED | slInnerProduct | VECTOR a,VECTOR b | Take the inner product of vectors |
Uint32 | slDec2Hex | Uint32 val | Conversion from BCD code to hexadecimal code |
Uint32 | slHex2Dec | Uint32 val | Conversion from hex code to BCD code |
Uint16 | slAng2Hex | ANGLE ang | Converting ANGLE code to hex code |
Uint16 | slAng2Dec | ANGLE ang | Conversion from ANGLE code to BCD code |
FIXED | slAng2FX | ANGLE ang | Conversion from ANGLE code to FIXED code |