| about | help | code help+videos | done | prefs |
findThirdSide
Create a method public double findThirdSide(double a, double b,angle C), given two sides and their included angle (in degrees) find and return the third side (in any triangle).The formula is a^2+b^2-2ab*cos(c) Not Math.cos takes in radians, not degrees. And there is Math.cos and Math.toRadians(x) findThirdSide(3, 4, 90.0) → 5.0 findThirdSide(3, 4, 40.0) → 2.5719512758107466 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy