<< Chapter < Page Chapter >> Page >

Once the required vectors had been created in Listing 3 , there is nothing new in the code in Listing 4 . Therefore, no explanation of Listing 4 should be required beyond the comments embedded in the code.

The bottom line on the program named DotProd3D05

The bottom line is that because the methods in the game-math library named GM02 were designed to do most of the hard work, writing application programs such as DotProd3D05 using the game-math library is not difficult at all. You simply need to understand how to organize your code to accomplish the thingsthat you need to accomplish.

That concludes the explanation of the program named DotProd3D05 .

The program named DotProd3D06

This program demonstrates how the dot product can be used to find vectors that are perpendicular to a given vector.

An infinite number of possibilities

Recall that you learned in the previous module that there are an infinite number of vectors that are perpendicular to a given vector in 3D. This programcomputes and displays normalized and scaled versions of six somewhat unique vectors of the infinite setof vectors that are perpendicular to a user specified vector.

The graphic output

The screen output from this program is shown in Figure 4 .

Figure 4 - Six (magenta) vectors that are perpendicular to a given (black) vector.

Missing image.

Output on the command-line screen

In addition to the graphic output shown in Figure 4 , the program also displays the values of three of the perpendicular vectors on the command-linescreen along with the angle between the perpendicular vector and the user-specified vector. The angle should always be 90 degrees or very close to 90degrees if the program is working properly. The other three of the six perpendicular vectors are simply negated versions of the three for which thevalues are displayed.

Special case of one zero coordinate value

If the user specifies one of the coordinate values to be zero (or close to zero) , the program only computes and displays four of the possible vectors in order to avoid performing division by a near-zero value. In this case, theorientation of two of the vectors will overlay the orientation of the other two. Because the vectors are normalized to the same length and occupy the same space,you will only see two vectors instead of four. This is illustrated in Figure 5 where the value of the z-axis coordinate value was set to zero relative to thevalue used in Figure 4 .

Figure 5 - Screen output when one coordinate has a value of zero.

Missing image.

Special case of two coordinates with a value of zero

If the user specifies two of the coordinate values to be zero or close to zero, the program doesn't produce a valid result. Instead, it draws aperpendicular vector where all of the coordinate values are zero resulting in a magenta vector head at the origin. It also displays NaN (Not a Number) for the angle on the command line screen.

The graphical user interface

The GUI shown in Figure 4 is provided to allow the user to enter three double values that define a GM02.Vector3D object. The GUI also provides an OK button in addition to a 3D drawing area.

Questions & Answers

Do somebody tell me a best nano engineering book for beginners?
s. Reply
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
how to fabricate graphene ink ?
SUYASH Reply
for screen printed electrodes ?
SUYASH
What is lattice structure?
s. Reply
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
Sanket Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
China
Cied
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
what is nano technology
Sravani Reply
what is system testing?
AMJAD
preparation of nanomaterial
Victor Reply
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
Himanshu Reply
good afternoon madam
AMJAD
what is system testing
AMJAD
what is the application of nanotechnology?
Stotaw
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
Hello
Uday
I'm interested in Nanotube
Uday
this technology will not going on for the long time , so I'm thinking about femtotechnology 10^-15
Prasenjit
can nanotechnology change the direction of the face of the world
Prasenjit Reply
At high concentrations (>0.01 M), the relation between absorptivity coefficient and absorbance is no longer linear. This is due to the electrostatic interactions between the quantum dots in close proximity. If the concentration of the solution is high, another effect that is seen is the scattering of light from the large number of quantum dots. This assumption only works at low concentrations of the analyte. Presence of stray light.
Ali Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!
QuizOver.com Reply

Get the best Algebra and trigonometry course in your pocket!





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