<< Chapter < Page Chapter >> Page >

That concludes the explanation of the program named DotProd2D02 .

The program named DotProd3D01

To understand this program, you need to understand the material in the Kjell tutorial through Chapter 8 - Length, Orthogonality, and the Column Matrix Dot product .

The purpose of this program is to confirm proper operation of the ColMatrix3D.dot method. The program creates a GUI that allows the user to enter three values for each of a pair of ColMatrix3D objects along with a button labeled OK . When the user clicks the OK button, the dot product of the two ColMatrix3D objects is computed and displayed.

A screen shot of the output from the program named DotProd3D01

A screen shot of the output from the program named DotProd3D01 is shown in Figure 15 . (Compare Figure 15 with Figure 14 .)

Figure 15 A screen shot of the output from the program named DotProd3D01.

Missing image.

Very similar to a previous program

Except for the fact that this program calls the dot method on an object of the GM02.ColMatrix3D class instead calling the dot method on an object of the GM02.ColMatrix2D class, this program is essentially the same at the program named DotProd2D01 that I explained earlier. Therefore, you should have no trouble understanding this programwithout further explanation from me. A complete listing of this program is provided in Listing 11 .

That concludes the explanation of the program named DotProd3D01 .

The program named DotProd3D02

You need to understand the material in the Kjell tutorial through Chapter 10, Angle between 3D Vectors to understand this program.

Program output

A screen shot of the output of this program is shown in Figure 12 . This program allows the user to experiment with the dot product and the angle betweena pair of GM02.Vector3D objects. A GUI is provided that allows the user to enter six double values that define each of two GM02.Vector3D objects. The GUI also provides an OK button as well as two text fields used for display of the computed results.

In addition, the GUI provides a 3D drawing area. When the user clicks the OK button, the program draws the two vectors, (one in black and the other in magenta) , on the output screen with the tail of each vector located at the origin in 3D space. The program also displays the values ofthe dot product of the two vectors and the angle between the two vectors in degrees. (Compare the output of this 3D program in Figure 12 with the output from the 2D program in Figure 3 .)

Program code

A complete listing of this program is provided in Listing 12 . Almost all of the new and interesting code in this program is in the method named actionPerformed .

Very similar to a previous program

If you compare the method named actionPerformed in Listing 12 with the actionPerformed method for the program named DotProd2D02 in Listing 10 , you will see that they are very similar. One calls 2D methods in the game-math library while the other calls 3D methods in the same library.Therefore, you should have no difficulty understanding this program without further explanation from me.

That concludes the explanation of the program named DotProd3D02 .

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Game 2302 - mathematical applications for game development. OpenStax CNX. Jan 09, 2016 Download for free at https://legacy.cnx.org/content/col11450/1.33
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Game 2302 - mathematical applications for game development' conversation and receive update notifications?

Ask