POV-Ray : Newsgroups : povray.general : Square Root problem Server Time
4 Nov 2024 21:23:25 EST (-0500)
  Square Root problem (Message 1 to 9 of 9)  
From: gharryh
Subject: Square Root problem
Date: 14 Mar 2010 10:40:01
Message: <web.4b9cf50c3ef55f81da0e3b8d0@news.povray.org>
The following problem:

From a triangle from whom i know the length of both legs (A and B) i want to
calculate the longest leg (C).
As i remember from school its C*C=A*A+B*B where A=62.5 and B=17.
Translated into PovRay its C=sqrt(pow(A,2)+pow(B,2)) but the result is much
smaller. The correct result for C should be +/-32.596

Code:
#local RH=149;  // Rail Height
#local FW=125;  // Flange Width
#local HT=65.4; // Head Width at Top
#local HB=70;   // Head Width at Base
#local HH=39.8; // Head Height
#local WT=14;   // Web Thickness
#local FE=10.5; // Flange Thickness at Edge
#local FM=27.5; // Flange Thickness at Center
#local Y_X=76;  // Gravity Center
#local FMT=degrees(atan((FM-FE)/(FW/2)));
//c = sqrt( pow( a , 2) + pow( b , 2 ) ) .
#local FE_FM=sqrt(pow((FM-FE),2)+pow(FE/2,2));

box{<0,FM,0><FE_FM,0,1> Rotate_Around_Trans(<0,0,-FMT><0,FM,0>) pigment {Red}}

End Code

But maybe there is a error in the box code becourse is i replace FE_FM with that
value is displayed wrong also.

Regards

Harry


Post a reply to this message

From: slair
Subject: Re: Square Root problem
Date: 14 Mar 2010 12:57:24
Message: <4b9d1574$1@news.povray.org>
14.03.2010 18:39, gharryh пишет:
> The following problem:
>
>  From a triangle from whom i know the length of both legs (A and B) i want to
> calculate the longest leg (C).
> As i remember from school its C*C=A*A+B*B where A=62.5 and B=17.
> Translated into PovRay its C=sqrt(pow(A,2)+pow(B,2)) but the result is much
> smaller. The correct result for C should be +/-32.596

it works only if angle between A and B is equal 90 degrees, in other 
case use e.g. theorem of sinus

A/sin(alpha) = B/sin(beta) = C/sin(gamma)

>
> Code:
> #local RH=149;  // Rail Height
> #local FW=125;  // Flange Width
> #local HT=65.4; // Head Width at Top
> #local HB=70;   // Head Width at Base
> #local HH=39.8; // Head Height
> #local WT=14;   // Web Thickness
> #local FE=10.5; // Flange Thickness at Edge
> #local FM=27.5; // Flange Thickness at Center
> #local Y_X=76;  // Gravity Center
> #local FMT=degrees(atan((FM-FE)/(FW/2)));
> //c = sqrt( pow( a , 2) + pow( b , 2 ) ) .
> #local FE_FM=sqrt(pow((FM-FE),2)+pow(FE/2,2));
>
> box{<0,FM,0><FE_FM,0,1>  Rotate_Around_Trans(<0,0,-FMT><0,FM,0>) pigment {Red}}
>
> End Code
>
> But maybe there is a error in the box code becourse is i replace FE_FM with that
> value is displayed wrong also.
>
> Regards
>
> Harry
>
>
>


Post a reply to this message

From: slair
Subject: Re: Square Root problem
Date: 14 Mar 2010 15:26:06
Message: <4b9d384e$1@news.povray.org>
14.03.2010 20:57, slair пишет:
> 14.03.2010 18:39, gharryh пишет:
>> The following problem:
>>
>> From a triangle from whom i know the length of both legs (A and B) i
>> want to
>> calculate the longest leg (C).
>> As i remember from school its C*C=A*A+B*B where A=62.5 and B=17.
>> Translated into PovRay its C=sqrt(pow(A,2)+pow(B,2)) but the result is
>> much
>> smaller. The correct result for C should be +/-32.596
>
> it works only if angle between A and B is equal 90 degrees, in other
> case use e.g. theorem of sinus
>
> A/sin(alpha) = B/sin(beta) = C/sin(gamma)

http://en.wikipedia.org/wiki/Law_of_sines

>>
>> Code:
>> #local RH=149; // Rail Height
>> #local FW=125; // Flange Width
>> #local HT=65.4; // Head Width at Top
>> #local HB=70; // Head Width at Base
>> #local HH=39.8; // Head Height
>> #local WT=14; // Web Thickness
>> #local FE=10.5; // Flange Thickness at Edge
>> #local FM=27.5; // Flange Thickness at Center
>> #local Y_X=76; // Gravity Center
>> #local FMT=degrees(atan((FM-FE)/(FW/2)));
>> //c = sqrt( pow( a , 2) + pow( b , 2 ) ) .
>> #local FE_FM=sqrt(pow((FM-FE),2)+pow(FE/2,2));
>>
>> box{<0,FM,0><FE_FM,0,1> Rotate_Around_Trans(<0,0,-FMT><0,FM,0>)
>> pigment {Red}}
>>
>> End Code
>>
>> But maybe there is a error in the box code becourse is i replace FE_FM
>> with that
>> value is displayed wrong also.
>>
>> Regards
>>
>> Harry
>>
>>
>>
>


Post a reply to this message

From: Vincent Le Chevalier
Subject: Re: Square Root problem
Date: 16 Mar 2010 08:15:19
Message: <4b9f7657$1@news.povray.org>
gharryh wrote:
> From a triangle from whom i know the length of both legs (A and B) i want to
> calculate the longest leg (C).
> As i remember from school its C*C=A*A+B*B where A=62.5 and B=17.
> Translated into PovRay its C=sqrt(pow(A,2)+pow(B,2)) but the result is much
> smaller. The correct result for C should be +/-32.596

I don't know where you get your C=32.596 from but this is impossible, in 
this case A would be bigger than B+C, which means that no triangle will 
have sides of these lengths, no matter what the angles are...

-- 
Vincent


Post a reply to this message

From: Alain
Subject: Re: Square Root problem
Date: 16 Mar 2010 16:29:41
Message: <4b9fea35@news.povray.org>
Le 2010-03-16 08:15, Vincent Le Chevalier a écrit :
> gharryh wrote:
>> From a triangle from whom i know the length of both legs (A and B) i
>> want to
>> calculate the longest leg (C).
>> As i remember from school its C*C=A*A+B*B where A=62.5 and B=17.
>> Translated into PovRay its C=sqrt(pow(A,2)+pow(B,2)) but the result is
>> much
>> smaller. The correct result for C should be +/-32.596
>
> I don't know where you get your C=32.596 from but this is impossible, in
> this case A would be bigger than B+C, which means that no triangle will
> have sides of these lengths, no matter what the angles are...
>

It can be possible, but definetly not in plane geometry.
If you trace your triangle on a curved surface, and the triangle is 
large relative to the curvature of said surface, the sum of the angles 
can get larger than 360 degrees, close to 539.999 degrees can become 
possible, and the relative length of the sides amount to any relations.
Trace a very large triangle around the Earth, 2 sumits on the equator 
and the third one 1mm away from it, located at longitudes 0, 120 and 
-120, and mesure the angles on the ground.


Alain


Post a reply to this message

From: Vincent Le Chevalier
Subject: Re: Square Root problem
Date: 16 Mar 2010 16:54:07
Message: <4b9fefef$1@news.povray.org>
Alain wrote:
> It can be possible, but definetly not in plane geometry.

Well it's not possible either in spherical geometry, and I doubt you'll 
find a "reasonable" space that does not respect triangle inequality...

Remember, my argument was not about the angles but about the distances. 
What I'm saying is that if you're looking for a triangle where the 
length of one side is longer than the sum of the lengths of the other 
two sides, you have bigger problems than the square root to worry about...

-- 
Vincent


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: Square Root problem
Date: 16 Mar 2010 17:28:28
Message: <4b9ff7fc@news.povray.org>
Vincent Le Chevalier wrote:
> Alain wrote:
>> It can be possible, but definetly not in plane geometry.
> 
> Well it's not possible either in spherical geometry, and I doubt you'll

> find a "reasonable" space that does not respect triangle inequality...
> 
> Remember, my argument was not about the angles but about the distances.

> What I'm saying is that if you're looking for a triangle where the
> length of one side is longer than the sum of the lengths of the other
> two sides, you have bigger problems than the square root to worry about
...
> 
	Actually, it is possible in spherical geometry. You just have to
remember that two points are not sufficient to define an edge on a
sphere: there are two possibilities, one of which goes around the
sphere...

		Jerome
-- 
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

From: Vincent Le Chevalier
Subject: Re: Square Root problem
Date: 16 Mar 2010 17:58:48
Message: <4b9fff18$1@news.povray.org>
Jérôme M. Berger wrote:
> 	Actually, it is possible in spherical geometry. You just have to
> remember that two points are not sufficient to define an edge on a
> sphere: there are two possibilities, one of which goes around the
> sphere...
> 

Ah yes, I was thinking of the triangles specified by joining the points 
according to the great-circle distance, i.e. the shortest arc between 
the vertices.

Problem is that if you allow to build triangles using the other arcs 
(the ones that go all the way around), you end up also allowing 
triangles that have intersecting sides, which is interesting, I guess, 
but then calling them triangles is perhaps slightly abusive :-)

-- 
Vincent


Post a reply to this message

From: gharryh
Subject: Re: Square Root problem
Date: 19 Mar 2010 10:45:01
Message: <web.4ba38d3071cdd7cfda0e3b8d0@news.povray.org>
Vincent Le Chevalier <gal### [at] libertyALLsurfSPAMfr> wrote:
> Jérôme M. Berger wrote:
> >  Actually, it is possible in spherical geometry. You just have to
> > remember that two points are not sufficient to define an edge on a
> > sphere: there are two possibilities, one of which goes around the
> > sphere...
> >
>
> Ah yes, I was thinking of the triangles specified by joining the points
> according to the great-circle distance, i.e. the shortest arc between
> the vertices.
> Vincent

Problem is solved using this:

#macro flange() // Create the bottom flange
difference {
        union {
                box{<0,FM,0><FE_FM,0,1> Rotate_Around_Trans(<0,0,-FMT><0,FM,0>)}
                box{<0,FM,0><-65,0,1> Rotate_Around_Trans(<0,0,FMT><0,FM,0>)}
                box{<-FW/2,0,0><FW/2,FE,1>}
                }
        box{<-FW/2,0,-0.1><FW/2,-FE*1.75,1.1>}
        }
#end

Harry


Post a reply to this message

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