skip a step

  • how do you skip a step in the for loop?
    For elementAngle = 0 To 2 * Pi Step 0.01
    For tiltAngle = 0 To Pi / 2 Step Pi / 12
    For windAngle = 0 To 2 * Pi Step Pi / 2
    c = c + 1
    If c > 30000 Then End


    when the tilt angle reaches pi/2, i want it to skip pi/2 and continue with 0 again.


    calculateXe = xb + (ze * Math.Tan(tiltAngle) - rad * Math.Cos(elementAngle - windAngle - Pi)) * Math.Cos(windAngle) - (-(rad * Math.Sin(elementAngle - windAngle - Pi)) * Math.Sin(windAngle))



    whenever the tilt angle is pi/2,the value of he is extremely large which is wrong.

  • Re: skip a step


    Why not use


    For tiltAngle = 0 To 5*(Pi / 12) Step Pi / 12


    You will still get to the same steps, just the end value is 5/12s of PI, not 6/12's

    Kieran

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!