POV-Ray : Newsgroups : povray.general : Square Root problem : Re: Square Root problem Server Time
30 Jul 2024 00:23:18 EDT (-0400)
  Re: Square Root problem  
From: slair
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

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