2019-07-05 10:05 AM
!!! Precaution against A == 0 or B == 0 BOXMAX = MAX(ABS(A), ABS(B), ABS(ZZYZX)) AA = A IF ABS(AA) < 1E-5 THEN AA = BOXMAX ENDIF BB = B IF ABS(BB) < 1E-5 THEN BB = BOXMAX ENDIF AA = AA/0.111238 BB = BB/0.251900 MUL2 AA, BB det = TR3D_1_1 * TR3D_2_2 + TR3D_1_2 * TR3D_2_1 xs = sqr (TR3D_1_1 * TR3D_1_1 + TR3D_2_1 * TR3D_2_1 + TR3D_3_1 * TR3D_3_1) ys = sqr (TR3D_1_2 * TR3D_1_2 + TR3D_2_2 * TR3D_2_2 + TR3D_3_2 * TR3D_3_2) if (det < 0.0) then xs = -xs endif xr = 0 yr = 0 if abs (xs) > 1e-5 then xr = TR3D_1_1 / xs yr = TR3D_2_1 / xs else if abs (ys) > 1e-5 then xr = TR3D_2_2 / ys yr = -TR3D_1_2 / ys else xr = 1 yr = 0 endif endif !!! Calculate atan2 (yr, xr) if abs (xr) < 1e-5 then if yr > 1e-5 then angle = 90 else angle = 270 endif else angle = atn (abs (yr / xr)) if xr < -1e-5 then if yr < -1e-5 then angle = angle + 180 else angle = 180 - angle endif else if yr < -1e-5 then angle = 360 - angle endif endif endif mul2 xs, ys rot2 angle FRAGMENT2 ALL, 0
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2021-05-24 04:57 PM
2021-05-25 03:48 AM
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2021-05-25 04:03 AM
2021-05-25 04:46 AM
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |