Closed Daniel-Martinez closed 10 years ago
created move and moveby methods that allow operator from command line to position the missile launcher in phi theta space.
Example Move:
double phi = 0; //create a value to store our phi, which is x,y left/right
phi = Convert.ToDouble(enteredValue); //converts entered value to a double
int temp = Convert.ToInt32(phi); //converts to int because our missleLauncher only understands integers, ### WE NEED TO ASK ABOUT THIS
if (phi < 0) //if entered value is less that zero it is a negative number and will move left.
{
int positive = Math.Abs(temp); //must take absolute value of number to enter into moveLeft function
Poseidon.command_Left(positive); //missle launcher moves left by amount entered
}
else
{
Poseidon.command_Right(temp); //if entered value is positive then we move right by amount entered
}
double theta = 0; //create a value to store our theta, which is Z up/down
theta = Convert.ToDouble(enteredValue2);
int temp2 = Convert.ToInt32(theta); //simalar to above
if (theta < 0)
{
int positive = Math.Abs(temp2);
Poseidon.command_Down(positive);
}
else
{
Poseidon.command_Up(temp2);
}>
Create a method in which user can enter coordinates in phi, theta to position missile launcher where it is required.