我有一个由起点和终点坐标(x0,y0,z0和x1,y1,z1)定义的3d矢量。我也知道这个矢量对x,y,z轴的角度。有人知道如何知道xy,yz和zx平面中矢量引起的角度?
答案 0 :(得分:0)
给定段到OXY平面的投影是具有坐标template<template<typename> class Cond, typename... T>
struct first_if_any {
using type = void;
static constexpr bool found = false;
};
template<template<typename> class Cond, typename First, typename... T>
struct first_if_any<Cond, First, T...> {
using type = typename std::conditional<Cond<First>::value || !first_if_any<Cond, T...>::found, First, typename first_if_any<Cond, T...>::type>::type;
static constexpr bool found = Cond<First>::value || first_if_any<Cond, T...>::found;
};
的段。
它形成相对于OX轴的角度:
(x1, y1) - (x2, y2)
段与其在OXY平面上的投影之间的角度为
Axy = atan2(y2-y1, x2-x1)