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

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