Объяснение: *координатный метод
#include <iostream>
#include <math. h>
struct Vec2f
{
float x, y;
};
Vec2f operator-(const Vec2f &l, const Vec2f &r)
{
return Vec2f{l. x - r. x, l. y - r. y};
};
Vec2f operator+(const Vec2f &l, const Vec2f &r)
{
return Vec2f{l. x + r. x, l. y + r. y};
};
float absVec(const Vec2f &v)
{
return sqrt(v. x * v. x + v. y * v. y);
};
int main(int argc, char *argv[])
{
float a, b, c, d, e, h;
//a = . . . ;
//b = . . . ;
//h = . . . ;
//e = . . . ;
Vec2f BC{b, 0};
Vec2f BD{sqrt(e * e - h * h), h};
Vec2f AB{sqrt(a * a - h * h), h};
c = absVec(BD - BC);
std::cout << c << "n";
d = absVec(AB + BD);
std::cout << d << "n";
}