Dim XTRange As Double Dim NearAngle As Double Dim FarAngle As Double Dim myAngle As Double If XTRange < 500 Then myAngle = NearAngle Else myAngle = FarAngle 'using this doubles the time ! A select Case instead made little difference 'myAngle = FarAngle 'If I uncomment the line above it speeds up again - even when leaving the above IF line intact. If isLyingInCone(Xx, Xy, Xz, Tx, Ty, Tz, Bx, By, Bz, myAngle) = True Then 'here we do the maths End if
myAngle = FarAngle
isLyingInCone(Xx, Xy, Xz, Tx, Ty, Tz, Bx, By, Bz, myAngle) = True
myAngle
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)