X
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time.
This article has been viewed 1,143 times.
Learn more...
This article teaches the user how write a program in a TI-Nspire calculator that takes the X, Y, and Z components of a vector and returns the vectors magnitude and its angles α (alpha), β (beta) , and γ (gamma), relative to the X, Y, and Z axes.
Steps
-
1Create a new document.
- Turn on your TI-Nspire calculator and select the “New Document” option.
-
2Add program editor.
- Once the new document is open, select option 9, “Add Program Editor” and “New”.
-
3Name and change library access.
- Once you select new, a menu will pop up which prompts you to: name the program, select the type of program and select the library access.
- This example is named “Vector” but you can choose any name less than 15 characters.
- Keep the type set to program and select 'LibPub' from the library access menu then select “ok”.
-
4Input the variables.
- Once you hit “ok” an empty program will show up with a spot to define input variables as well as an empty program body.
- For this program you want to input the X, Y, and Z coordinates of a vector and return the vector’s magnitude and direction angles.
- In the first line where it says “Define” you are going to define three variables X,Y, and Z by typing them inside the parentheses as shown.
- These variables act as placeholders for the X,Y, and Z components of your vector and when you use the program later the X, Y and Z will be replaced with the vector components.
-
5Vector the magnitude.
- Using calculus, we know that the magnitude of a vector [X, Y, Z] is equal to the square root of the summation of each component squared.
- You can program your calculator to output this by storing it as the variable m.
- To do this we type the square root of the summation of each component squared followed by “store” followed by M into the program body as shown.
- You can get to the store key by hitting the "ctrl" key then the "var" key.
-
6Set the angles.
- In order to find the direction angles of the vector, you first need to unitize the vector.
- Using calculus, a unit vector is found by dividing each component of the vector by the vector magnitude.
- Next, you take the inverse cosine of each unitized component to obtain the angle relative to the respective axis.
- For example, the inverse cosine of the unitized X component will give the vector’s angle relative to the X axis.
- We set the angle relative to the X axis as alpha, the Y axis as beta and the Z axis as gamma:
-
7Display the variables.
- In order for your work to show up in the workspace you need to display your variables.
- To do this first select menu, option 6 "I/O", then option one "Disp". Disp is short for display and will pop into the program body.
- Finally type in your magnitude, alpha, beta and gamma variables each separated by a comma.
-
8Save the program.
- In order to save the program inside of the document, hit the menu button on your calculator.
- Next select option 2, "Check Syntax and Store". From the following menu select the first option, "Check Syntax and Store".
-
9Save the document.
- In order to run the program from the scratchpad you will need to save the document to “MyLib”.
- Click the Doc button, "File", then “Save As”.
- Once you are in the Save As menu you need to select MyLib for the “Save In” dropdown menu. This document is named “Programs” but you can name yours however you’d like.
-
10Refresh the libraries.
- The last thing you must do before running the program is to refresh the calculator libraries.
- Hit the Doc button again then select the “Refresh Libraries” option.
-
11Access your program.
- In order to access the program, first click the library button on your calculator (it is the open book icon).
- Next, go to the fifth page of the library menu. There you should see the name of your document as one of the options.
- Select this option and the program will show up underneath.
-
12Run your program.
- Click the program and it will open into the workspace.
- Input the X, Y, and Z components of your vector.
- Once the program runs, the first number returned will be the vector magnitude, the second will be the angle alpha, followed by beta and gamma.
-
13Run the program with a 2D vector.
- In order to run the program for a 2D vector with only Y and X components all you need to do is enter 0 for the Z component of your vector.
- When running the program the angle relative to the Z axis will always be 90 degrees.


























































