Search:

Type: Posts; User: geezlouise

Search: Search took 0.18 seconds.

  1. Replies
    11
    Views
    1,052

    Re: Need help with my code (physics pendulum)

    Well the variable that controls the while loop are anlgeIsZero and angleIsZeroNext.As long as they are equal to zero then the loop would continue...angleIsZero and angleIsZeroNext are basically...
  2. Replies
    11
    Views
    1,052

    Re: Need help with my code (physics pendulum)

    int j = 0; // Index looping over time
    double angleIsZero = 0; // Storing the time when angle is zero

    while(angleIsZero == 0)
    {
    // If the angle switch sign...
  3. Replies
    11
    Views
    1,052

    Re: Need help with my code (physics pendulum)

    I think I'm stuck in an infinite loop...this is what is written on line 169:




    if(angle[j]*angle[j+1]<0){
    // Choose the angle with the smallest magnitude
    angleIsZeroNext =...
  4. Replies
    11
    Views
    1,052

    Re: Need help with my code (physics pendulum)

    Yeah..I don't understand what makes that happen though.And its out of bounds in what array?Is there a way to find out?
  5. Replies
    11
    Views
    1,052

    Re: Need help with my code (physics pendulum)

    Hey thanks for your reply,Norm.So its kind of odd but I only get an out of bounds error when I change the drivingForce to anything but zero,my code works when its zero but i get an error whenever i...
  6. Replies
    11
    Views
    1,052

    Need help with my code (physics pendulum)

    import java.io.*;

    public class omg
    {
    // Declare constants

    public static final double DT = 1e-2; // time interval in seconds
    public static final double Tmax = 1000.; //...
Results 1 to 6 of 6