Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.
2004-12-09 10:09 PM
2004-12-09 11:16 PM
IF A <> 0 THEN ratio=b/a ang=atn(ratio) ELSE (something to fix the problem) ENDIF
2004-12-09 11:45 PM
2004-12-10 12:59 AM
2004-12-10 01:47 AM
2004-12-10 02:44 AM
2004-12-10 03:47 AM
2004-12-10 11:09 AM
2004-12-10 11:48 AM
rocorona wrote:Yes, this is similar to what GS programmers do in their GDL Scripts.
I don't have a more efficient solution. Usually, when I know that a divisor can became zero, I use the following form:
epsilon = 0.000001 ! <--at the beginning of the current (or Master) Script
ratio=b/MAX(a, epsilon)
ang=atn(ratio)
This way the error message can be avoided.
But, if the number can also be negative, the formula has to be more complex. ... I think something like this:
ratio=b / (MAX(ABS(a), epsilon) * (sgn(a)+(a=0)))
GASP!
![]()
_______________________________
--Roberto Corona--
2004-12-10 12:07 PM