POV-Ray : Newsgroups : povray.general : unexpected rotation result Server Time
8 Aug 2024 16:21:30 EDT (-0400)
  unexpected rotation result (Message 19 to 28 of 48)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Marc-Hendrik Bremer
Subject: Re: unexpected rotation result
Date: 6 Feb 2001 07:31:34
Message: <3a7feea6$1@news.povray.org>
Scott Hill schrieb in Nachricht <3a7fe7cb@news.povray.org>...
>Without brackets it is ambiguous, to a
>degree - we may default to assuming that we're meant to follow the standard
>operator order rules but we don't and can't know that that assumption is
>correct.


Well, it is even ambiguous with brackets. Cause if you don't fallow the
standard rules, you could give the brackets a totally different meaning.
That's what makes all communication that faulty - we assume, that we follow
the same rules, but most of the time we don't. As a wise man said ones - it
is more of an wonder that communication does happens most of the time in a
correct way than the opposite.

Marc-Hendrik


Post a reply to this message

From: Warp
Subject: Re: unexpected rotation result
Date: 6 Feb 2001 07:37:08
Message: <3a7feff3@news.povray.org>
Gail Shaw <gsh### [at] monotixcoza> wrote:
: I would guess that pov is doing the multiplication first then adding 45.

  Well, that's exactly what it should do because that's the correct behaviour.
Multiplication has higher precedence than addition.

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Scott Hill
Subject: Re: unexpected rotation result
Date: 6 Feb 2001 13:27:35
Message: <3a804217@news.povray.org>
"Marc-Hendrik Bremer" <Mar### [at] t-onlinede> wrote in message
news:3a7feea6$1@news.povray.org...
>
> Scott Hill schrieb in Nachricht <3a7fe7cb@news.povray.org>...
> >Without brackets it is ambiguous, to a
> >degree - we may default to assuming that we're meant to follow the
standard
> >operator order rules but we don't and can't know that that assumption is
> >correct.
>
>
> Well, it is even ambiguous with brackets. Cause if you don't fallow the
> standard rules, you could give the brackets a totally different meaning.
> That's what makes all communication that faulty - we assume, that we
follow
> the same rules, but most of the time we don't. As a wise man said ones -
it
> is more of an wonder that communication does happens most of the time in a
> correct way than the opposite.
>

    Hmm, yes, but not in the same way - you may as well say that it's
ambiguous because we _could_ interpret the numerical digits differently -
the problem is not that we're misinterpret anything, but, rather that there
isn't enough information in the original form - we need the precedence rules
to remove the ambiguity but they do not redefine or even clarify the meaning
of any of the symbols ('+' stills means 'plus', '-' still means 'minus' and
'*' still means 'times'). Likewise, adding brackets does not change the
meanings of any of the symbols, they just clarify how those symbols are
intended to interact.

Does that make any sense ?

Scott.


Post a reply to this message

From: Tom Melly
Subject: Re: unexpected rotation result
Date: 6 Feb 2001 14:45:34
Message: <3a80545e@news.povray.org>
"Scott Hill" <sco### [at] ncgraphicsnet> wrote in message
news:3a804217@news.povray.org...

<snip>

>     Hmm, yes, but not in the same way - you may as well say that it's
> ambiguous because we _could_ interpret the numerical digits differently -

<snip>

Exactly - the sentence "the man went into the farmer's toilet and took his
trousers down" is ambiguous because we don't know whether the man takes his
own or the farmer's trousers down. It is also ambiguous because "trousers"
could mean "dictation". However, one is an ambiguity within the rules of
English, whereas the latter is only ambiguous if we ignore the rules of
English. We resolve the first by using common sense - we would generally
assume that the man takes his own trousers down (unless the book has been
purchased in a specialist shop and is being read one-handed).

Unfortunately, there is no common sense that can resolve "3+2*5". There is
nothing to imply that the multiplication occurs first. It would not be
illogical to write a parser that evaluated the addition first - it doesn't
break a rule, so much as a convention designed to resolve the inherant
ambiguity. However, to write a parser that ignored brackets or treated them
as some other operator would be an act of blatent idiocy.


Post a reply to this message

From: Marc-Hendrik Bremer
Subject: Re: unexpected rotation result
Date: 6 Feb 2001 15:02:14
Message: <3a805846@news.povray.org>
Scott Hill schrieb in Nachricht <3a804217@news.povray.org>...

>Does that make any sense ?
>


Yes, it does. But only if you use a hierarchic structure for the rules, you
use. From a strictly mathematical point of you (I think) there is no
difference in the rule that multiplications are done before additions and
the one that tells you, what brackets mean or what the digit "2" mean. Or is
this not right?

From a more general point of view you and Tom are absolutely right of
course.

Marc-Hendrik


Post a reply to this message

From: David Fontaine
Subject: Re: unexpected rotation result
Date: 6 Feb 2001 18:17:03
Message: <3A8085CA.B22C86A5@faricy.net>
Scott Hill wrote:

>     No ! 5.
>
>     That's the point - we and parsers all assume, because we've all learned
> (or, in the case of parsers, have been hard coded with) the correct operator
> ordering, that it evaluates to 3, but, I may not have meant that, I could
> just as easily meant ((1+2)*3)-4 ! Without brackets it is ambiguous, to a
> degree - we may default to assuming that we're meant to follow the standard
> operator order rules but we don't and can't know that that assumption is
> correct.

NO!! 1+2*3-4 is three, only three, exactly three, no more, no less, and most
certainly not and NEVER five. If you meant (1+2)*3-4, that would be analagous to
me typing orange and meaning purple. Anyone who types 1+2*3-4 and expects 5 is
an idiot.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: David Fontaine
Subject: Re: unexpected rotation result
Date: 6 Feb 2001 18:19:51
Message: <3A808672.D37E6BD5@faricy.net>
Tom Melly wrote:

> Unfortunately, there is no common sense that can resolve "3+2*5". There is
> nothing to imply that the multiplication occurs first.

[snip]
Of course there is. It's called simple algebra.
a*x^2+b*x+c means what to you?

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Mark Wagner
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 00:20:58
Message: <3a80db3a$1@news.povray.org>
David Fontaine wrote in message <3A8085CA.B22C86A5@faricy.net>...
>NO!! 1+2*3-4 is three, only three, exactly three, no more, no less, and
most
>certainly not and NEVER five. If you meant (1+2)*3-4, that would be
analagous to
>me typing orange and meaning purple. Anyone who types 1+2*3-4 and expects 5
is
>an idiot.


I just typed the expression 1+2*3-4 into my TI-1795 calculator, and, as
expected, got the number 5.

--
Mark


Post a reply to this message

From: Tom Melly
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 04:24:39
Message: <3a811457$1@news.povray.org>
"David Fontaine" <dav### [at] faricynet> wrote in message
news:3A808672.D37E6BD5@faricy.net...
> Tom Melly wrote:
>
> > Unfortunately, there is no common sense that can resolve "3+2*5". There
is
> > nothing to imply that the multiplication occurs first.
>
> [snip]
> Of course there is. It's called simple algebra.
> a*x^2+b*x+c means what to you?
>

(a*(x^2)) + (b*x) + c - but this is not common sense, it is following a
convention that exists because common sense is not available.

In fact, one could argue that the only common sense option is to evaluate
the expression strictly left to right. IMHO common sense would dictate that
the solution is: (a*x)^2 + (b*x) + c.


Post a reply to this message

From: Tom Melly
Subject: Re: unexpected rotation result
Date: 7 Feb 2001 04:27:17
Message: <3a8114f5$1@news.povray.org>
"David Fontaine" <dav### [at] faricynet> wrote in message
news:3A8085CA.B22C86A5@faricy.net...

> NO!! 1+2*3-4 is three, only three, exactly three, no more, no less, and
most
> certainly not and NEVER five. If you meant (1+2)*3-4, that would be
analagous to
> me typing orange and meaning purple. Anyone who types 1+2*3-4 and expects
5 is
> an idiot.
>

I disagree. Anyone who types 2*1.5 and expects 5 is an idiot. Typing 1+2*3-4
and expecting 5 just means that they don't know the conventions. The
conventions exist because intelligence alone cannot resolve the issue.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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