473,698 Members | 2,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

acos(1.000000) = -1.#IND00 ???

Hi -

I'm computing the angle between pairs of unit vectors as the arc
cosine of the dot product of each pair of vectors. Occasionally, when
the dot product is 1.000000 (output to 6 decimal places) I get the
value -1.#IND00 ! What does this mean?

Thanks,

- Olumide
PS: if it helps, I'm using Visual Studio .NET 2003 on a Windows XP
machine.

Oct 14 '07 #1
3 4569
On 2007-10-14 21:33, Olumide wrote:
Hi -

I'm computing the angle between pairs of unit vectors as the arc
cosine of the dot product of each pair of vectors. Occasionally, when
the dot product is 1.000000 (output to 6 decimal places) I get the
value -1.#IND00 ! What does this mean?
It probably means that one of the decimals that you have not shown is
greater than 1. acos is only defined for values in the range -1 to 1
inclusive, for other values of input a domain error occurs and it is up
to the implementation what will be returned. In VC++ this produces a so
called quiet NaN (Not A Number) which looks like -1.#IND when printed.

--
Erik Wikström
Oct 14 '07 #2
On 2007-10-14 22:13, Erik Wikström wrote:
On 2007-10-14 21:33, Olumide wrote:
>Hi -

I'm computing the angle between pairs of unit vectors as the arc
cosine of the dot product of each pair of vectors. Occasionally, when
the dot product is 1.000000 (output to 6 decimal places) I get the
value -1.#IND00 ! What does this mean?

It probably means that one of the decimals that you have not shown is
greater than 1.
Sorry, that should be "greater than 0".

--
Erik Wikström
Oct 14 '07 #3
On 14 Oct, 21:24, Erik Wikström <Erik-wikst...@telia. comwrote:
On 2007-10-14 22:13, Erik Wikström wrote:
I'm computing the angle between pairs of unit vectors as the arc
cosine of the dot product of each pair of vectors. Occasionally, when
the dot product is 1.000000 (output to 6 decimal places) I get the
value -1.#IND00 ! What does this mean?
It probably means that one of the decimals that you have not shown is
greater than 1.

Sorry, that should be "greater than 0".
Thanks, I should have known that ;-) .

Oct 14 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
13611
by: Jean-François Michaud | last post by:
Hello people, I am rather puzzled by this problem I am having with doubles here. The code seems to execute correctly for awhile and then all a sudden printfing out my doubles, I get -1.#IND00 which seems to be an indeterminate or -infinity or something of the such. I am coding an IAC network and the problem occurs only in learning mode when the values approach 1.00 (the values SHOULD stay between between -0.2 and 1.0, but they...
5
2362
by: billynastie2007 | last post by:
Hi i am writing a balloon race site and i am having problems with some functions to calculate the distance the balloon travels firstly i am reading my info from the database using the fetch assoc function what i have is 2 table one for the race details and one for the postcode details what i am having problems with is listing all the races in the database then having a coloumn at the end which tell you how far the balloon has travelled i have...
10
3823
by: ratcharit | last post by:
Currently using cosine function in math.h Currently I get: 1 = cos(1e^-7) Is there another way for cos to return value of high accuracy say: 0.999999 = cos(1e^-7)
16
3391
by: drwyness | last post by:
Hello, Please help with the following problem it is causing me some headaches. The following javascript code is designed to fill in text boxes with numbers on an online game (tribalwars). It works fine for everyone else and even the link to the script that I am personally using has been used on other people computers successfully. I have tried this on both IE7 and the latest Firefox. My options show javascript is enabled and even other...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9028
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7728
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.