#include <xtd/console>
#include <xtd/math>
#include <xtd/startup>
namespace math_example {
class math_trapezoid_sample {
public:
static auto main() {
auto trpz = math_trapezoid_sample {20.0, 10.0, 8.0, 6.0};
console::write_line(
"The trapezoid's bases are 20.0 and 10.0, the trapezoid's legs are 8.0 and 6.0");
auto h = trpz.get_height();
auto dx_r = trpz.get_left_base_radian_angle();
auto dy_r = trpz.get_right_base_radian_angle();
auto dx_d = trpz.get_left_base_degree_angle();
auto dy_d = trpz.get_right_base_degree_angle();
}
math_trapezoid_sample(double long_base, double short_base, double left_leg, double right_leg) {
}
auto get_height()->double {
auto x = get_right_small_base();
}
auto get_square()->double {
return get_height() * long_base_ / 2.0;
}
auto get_left_base_radian_angle()->double {
auto sin_x = get_height() / left_leg_;
}
auto get_right_base_radian_angle()->double {
auto x = get_right_small_base();
}
auto get_left_base_degree_angle()->double {
}
auto get_right_base_degree_angle()->double {
}
private:
auto get_right_small_base()->double {
return (
math::pow(right_leg_, 2.0) -
math::pow(left_leg_, 2.0) +
math::pow(long_base_, 2.0) +
math::pow(short_base_, 2.0) - 2 * short_base_ * long_base_) / (2 * (long_base_ - short_base_));
}
double long_base_ = .0;
double short_base_ = .0;
double left_leg_ = .0;
double right_leg_ = .0;
};
}
startup_(math_example::math_trapezoid_sample::main);
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static double sqrt(double value)
Returns the square root of a specified number.
static decimal abs(decimal value)
Returns the absolute value of a decimal number.
static double radians_to_degrees(double radians) noexcept
Convert radians to degrees.
static double pow(double x, double y)
Returns a specified number raised to the specified power.
static decimal round(decimal value)
Rounds a double-precision floating-point value to the nearest integral value.
static double acos(double value)
Returns the angle whose cosine is the specified number.
static double asin(double value)
Returns the angle whose sine is the specified number.
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:167
@ h
The H key.
Definition console_key.hpp:102
@ x
The X key.
Definition console_key.hpp:134
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8