Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Owner2229
in reply to: Anonymous

What's the "If Start..." still doing there?

Trigger it with the "Distance_To_Center" parameter change.

 

s = Distance_To_Center

Dim MyList(3) As Double
MyList(0) = X_Afstand_1_Ruit
MyList(1) = X_Afstand_2_Ruit
MyList(2) = X_Afstand_3_Ruit
MyList(3) = X_Afstand_4_Ruit

Array.Sort(MyList)
MessageBox.Show(MyList(1), "Co�rdinate left")
MessageBox.Show(MyList(2), "Co�rdinate right")

'Don't repeat calculations, pre-calculate them
Dim G As Double = (Binnen_diameter_Ruit / 2) + Laagdikte_Ruit Dim I As Double = Abs(MyList(1)) / G Dim J As Double = (Asin(I) * 180) / PI Dim M As Double = Abs(MyList(2)) / G Dim N As Double = (Asin(M) * 180) / PI

'The mess that used to be here was your (current) problem
'Formate your formulas to be HUMAN readable
'In formulas: shorter =/= better

Dim Q As Double = Nothing If (MyList(2) < 0) And (MyList(1) < 0) Then
Q = J - N
ElseIf (MyList(2) > 0) And (MyList(1) > 0) Then
Q = N - J ElseIf (MyList(2) < 0) And (MyList(1) > 0) Then
Q = J + N End If MessageBox.Show(Q, "angle")
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods