POV-Ray : Newsgroups : povray.general : abs()? Server Time
29 Nov 2024 17:41:46 EST (-0500)
  abs()? (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Tim Cook
Subject: Re: abs()?
Date: 16 Nov 2005 07:00:57
Message: <437b1f79$1@news.povray.org>
Anthony D. Baye wrote:
>> "abs(A) Absolute value of A. If A is negative, returns -A otherwise 
>> returns A."
> Thus:
> abs(x) returns the MAGNITUDE of x, such that |x|=|-x|.  This value is 
> always positive.

Ahhhh ok, I just stumbled on the minus sign in confusion, as if you're 
not paying close attention it looks redundant and as though it returns a 
negative number.  Isn't there a better way of wording the docs there?

-- 
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Chris B
Subject: Re: abs()?
Date: 16 Nov 2005 07:34:56
Message: <437b2770$1@news.povray.org>
"Tim Cook" <z99### [at] bellsouthnet> wrote
> Isn't there a better way of wording the docs there?
>
> -- 
> Tim Cook
>

If you can think of one you could propose it on 
povray.documentation.inbuilt.

Chris B.


Post a reply to this message

From: Tom Melly
Subject: Re: abs()?
Date: 16 Nov 2005 11:23:11
Message: <437b5cef$1@news.povray.org>
"Tim Cook" <z99### [at] bellsouthnet> wrote in message 
news:437b1f79$1@news.povray.org...
>
> Ahhhh ok, I just stumbled on the minus sign in confusion, as if you're not 
> paying close attention it looks redundant and as though it returns a 
> negative number.  Isn't there a better way of wording the docs there?
>

Dunno - but IMHO it is a basic, albeit slippery, principle.


Post a reply to this message

From: Warp
Subject: Re: abs()?
Date: 16 Nov 2005 14:17:11
Message: <437b85b7@news.povray.org>
Tim Cook <z99### [at] bellsouthnet> wrote:
> Isn't there a better way of wording the docs there?

  Mathematicians understand it perfectly. Programmers understand it
perfectly.

  How can you explain it to someone who is neither? You would have to
start from number theory principles...

  What is curious is that people get confused but they don't try to think
about it at all. How would you understand "if A is negative, returns -A"?

  If it said "if A is negative, returns A" then that would obviously mean
that it doesn't change it. If it, however, returns "-A" then it has to
change it somehow because "A" is not the same as "-A".

-- 
                                                          - Warp


Post a reply to this message

From: Tim Cook
Subject: Re: abs()?
Date: 16 Nov 2005 14:28:13
Message: <437b884d$1@news.povray.org>
Warp wrote:
>   What is curious is that people get confused but they don't try to think
> about it at all. How would you understand "if A is negative, returns -A"?

I see "if A is negative" and parse "-A", then the -A following that 
makes me think "-A, returns -A", instead of "if the number is negative, 
the sign is dropped".

-- 
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Daniel Hulme
Subject: Re: abs()?
Date: 16 Nov 2005 15:02:43
Message: <20051116200255.3391aef0@surreal>
>   How can you explain it to someone who is neither? You would have to
> start from number theory principles...
returns -1 * A?

-- 
Stop the infinite loop, I want to get off!    http://surreal.istic.org/ 
Paraphernalia/Never hides your broken bones,/ And I don't know why you'd
want to try:/ It's plain to see you're on your own.        -- Paul Simon
v2sw6PChw7ln6pr4ck5ma9u8Lw3m2l7Di2e6t2TNDb9Ien6g6a2Xr1p6/9 hackerkey.com


Post a reply to this message

From: Kenneth
Subject: Re: abs()?
Date: 17 Nov 2005 01:05:01
Message: <web.437c1c86e81deef51358cd00@news.povray.org>
Tim Cook <z99### [at] bellsouthnet> wrote:
> From the documentation:
>
> "abs(A) Absolute value of A. If A is negative, returns -A otherwise
> returns A."
>

Not too long ago, this very subject was addressed in a different thread..

<43401940$1@news.povray.org>

The level of confusion that abs() seems to generate among some users DOES
indicate, IMHO, that a "better" description is needed in the docs.  OR
perhaps just an example of its use! In fact, there are other "math"
keywords that could use examples as well, to help the non-mathematician.

Ken


Post a reply to this message

From: Rune
Subject: Re: abs()?
Date: 18 Nov 2005 03:37:11
Message: <437d92b7@news.povray.org>
Tim Cook wrote:
> Anthony D. Baye wrote:
>>> "abs(A) Absolute value of A. If A is negative, returns -A otherwise
>>> returns A."
>> Thus:
>> abs(x) returns the MAGNITUDE of x, such that |x|=|-x|.  This value is
>> always positive.
>
> Ahhhh ok, I just stumbled on the minus sign in confusion, as if you're
> not paying close attention it looks redundant and as though it
> returns a negative number.  Isn't there a better way of wording the
> docs there?

Not a replacement, but maybe an addition?

"Thus, no matter if A is positive or negative (or zero), abs(A) will return 
a positive number (or zero)."

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Darren New
Subject: Re: abs()?
Date: 18 Nov 2005 11:55:48
Message: <437e0794$1@news.povray.org>
Rune wrote:
> Not a replacement, but maybe an addition?

I find examples usually help, too.
   So, abs(0) is 0, abs(12) is 12, and abs(-5) is 5. The result is never 
negative.

-- 
   Darren New / San Diego, CA, USA (PST)
    Sabotage? Communist conspiracy? Or just
    Microsoft again? Only time will tell.


Post a reply to this message

From: Rune
Subject: Re: abs()?
Date: 19 Nov 2005 08:37:22
Message: <437f2a92$1@news.povray.org>
Darren New wrote:
> Rune wrote:
>> Not a replacement, but maybe an addition?
>
> I find examples usually help, too.
>   So, abs(0) is 0, abs(12) is 12, and abs(-5) is 5. The result is
> never negative.

Yes, agreed.

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

<<< Previous 5 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.