All pastes #405222 Raw Edit

Something

public text v1 · immutable
·published 2007-03-21 16:39 UTC
rendered paste body
<?php

$a = 50;
$b = 30;

$p1 = 80;
$p2 = 30;
$p3 = -30;
$p4 = -80;

$maxx = 80;
$minx = -80;

$x = 40;
$z = 30;

// R2
$r2_lat = $p1 - $x;
echo "Latura adiacenta = <b>$r2_lat</b><br>";
$r2 = sqrt((pow($r2_lat, 2)) + (pow($z, 2)));
$r22 = (sqrt(pow($r2_lat, 2) + pow($z, 2) - $r2_lat * $z * cos(deg2rad(90)) * 2));
echo "Latura r2 = <b>$r2</b> ($r22)<br>";
$beta = $z / $r2_lat; 
$beta = atan($beta);
echo "Unghiul Beta= <b>". rad2deg($beta) ."</b><br><hr>";

// R1
$r1_lat = $p2 - $x;
echo "Latura adiacenta = <b>".abs($r1_lat)."</b><br>";
$r1 = sqrt((pow($r1_lat, 2)) + (pow($z, 2)));
$r11 = (sqrt(pow($r1_lat, 2) + pow($z, 2) - $r1_lat * $z * cos(deg2rad(90)) * 2));
echo "Latura r1 = <b>$r1</b> ($r11)<br>";
$alfa = 50 / $r2;
$alfa = atan($alfa);
echo "Unghiul Alfa= <b>". rad2deg($alfa) ."</b><br><hr>";

// R2'
$r2p_lat = abs($p4) + $x;
echo "Latura adiacenta = <b>$r2p_lat</b><br>";
$r2p = sqrt((pow($r2p_lat, 2)) + (pow($z, 2)));
$r22p = (sqrt(pow($r2p_lat, 2) + pow($z, 2) - $r2p_lat * $z * cos(deg2rad(90)) * 2));
echo "Latura r2' = <b>$r2p</b> ($r22p)<br>";
$betap = $z / $r2p_lat; 
$betap = atan($betap); 
echo "Unghiul Beta'= <b>". rad2deg($betap) ."</b><br><hr>";

// R1'
$r1p_lat = abs($p3) + $x;
echo "Latura adiacenta = <b>".abs($r1p_lat)."</b><br>";
$r1p = sqrt((pow($r1p_lat, 2)) + (pow($z, 2)));
$r11p = (sqrt(pow($r1p_lat, 2) + pow($z, 2) - $r1p_lat * $z * cos(deg2rad(90)) * 2));
echo "Latura r1' = <b>$r1p</b> ($r11p)<br>";
$alfap = 50 / $r2p;
$alfap = atan($alfap);
echo "Unghiul Alfa= <b>". rad2deg($alfap) ."</b><br><hr>";

// TEST LATURA
$test = 70 / $r1;
$test = atan($test);
echo "Unghiul de test= <b>". rad2deg($test) ."</b><br><hr>";

$arc = $alfa + $beta + $betap + $alfap + $test;
echo "Total: ".rad2deg($arc)."<br>";



?>