next up previous
Next: Assignment Statements Up: Fortran 90 Type Previous: Fortran 90 Type

Extensions of the Robot's Arm Program

We can extend the solution method to solve for the X and Y coordinate position of the robotic wrist joint. Once the position of the elbow joint is known, two more pieces of information are required to locate the wrist:

  1. The length of the robotic forearm.
  2. The angle of the robotic elbow joint.

The rbtjnts.f program can also be modified to compute the wrist position. First of all appropriate variable declarations need to be added to the program near the declarations already in place. The new variable declarations would probably look something like this:

      real :: forearml
      real :: elbowd, elbowr
      real :: wristx, wristy

where:

We must not forget to include comments in the program that describe these new variables. Remember that in Fortran variable declaration statements must be placed near the beginning of the program. In Fortran they must appear right after the program line with any intervening comment lines and blank lines ignored. All of the variable declarations must come before any other kinds of statements in the program. If you put a variable declaration in a place it doesn't belong, the compiler will complain when you tell it to compile your program.


next up previous
Next: Assignment Statements Up: Fortran 90 Type Previous: Fortran 90 Type


J. C. Diaz