Skip to content

Commit

Permalink
geometria
Browse files Browse the repository at this point in the history
  • Loading branch information
GDAndres98 committed Feb 13, 2020
1 parent 5f17246 commit 36af136
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Cpp/UVa10286_TroubleWithAPentagon.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// UVA 10286
// UVa10286_Trouble with a Pentagon

#include <iostream>
#include <cmath>
#include <iomanip>

#define PI 3.14159265359


using namespace std;

double sin_deg(double deg) {
return sin((deg * PI) / 180.0);
}


int main() {
double l;
while (cin >> l) {
cout << fixed << setprecision(10) << (l*sin_deg(108) / (sin_deg(63))) << endl;
}
}
/*
*
1 2 3 4
1 2 3 4
1 2 3 4
*/
44 changes: 44 additions & 0 deletions Cpp/UVa11909_SoyaMilk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// UVA 11909
// UVa11909_SoyaMilk

#include <iostream>
#include <cmath>
#include <iomanip>

#define PI 3.14159265359


using namespace std;

int main() {
double l, w, h, t;
double area;
while (cin>>l>>w>>h>>t) {


double areaA = l * h;
t = (t * PI) / 180.0;
if (t < atan(h / l)) {
double x = PI - t - PI / 2;
double z = (l * sin(t)) / sin(x);
double areaB = (l * z) / 2.0;
area = (areaA - areaB) * w;
} else {
t = PI/2-t;
double x = PI - t - PI / 2;
double z = (h * sin( t)) / sin(x);
area = ((h * z) / 2.0) * w;
};
cout << fixed << setprecision(3) << area << " mL" << endl;
}


return 0;
}
/*
*
1 2 3 4
1 2 3 4
1 2 3 4
*/

0 comments on commit 36af136

Please sign in to comment.