57 lines
988 B
C++
57 lines
988 B
C++
//
|
||
// Created by xtkuang on 2025/7/7.
|
||
//
|
||
|
||
#ifndef GEOMETRY_H
|
||
#define GEOMETRY_H
|
||
|
||
namespace cmvr::math {
|
||
typedef struct {
|
||
double x;
|
||
double y;
|
||
} Vec2;
|
||
|
||
typedef struct {
|
||
double x;
|
||
double y;
|
||
double z;
|
||
} Vec3;
|
||
|
||
/// quat
|
||
typedef struct {
|
||
double w;
|
||
double x;
|
||
double y;
|
||
double z;
|
||
} Quat;
|
||
|
||
/// position 3d
|
||
typedef struct {
|
||
double x; //* unit: m
|
||
double y;
|
||
double z;
|
||
} Position;
|
||
|
||
/// euler angel
|
||
typedef struct {
|
||
double rx; //* unit: rad
|
||
double ry;
|
||
double rz;
|
||
} Euler;
|
||
|
||
/// pose 3d
|
||
typedef struct {
|
||
Position position; ///< 位置,单位:m
|
||
Quat quaternion; ///< 四元数
|
||
Euler euler; ///< 欧拉角,单位:rad
|
||
} Pose3d;
|
||
|
||
typedef struct {
|
||
double x; //* unit: m
|
||
double y;
|
||
double theta;
|
||
} Pose2d;
|
||
}
|
||
|
||
|
||
#endif //GEOMETRY_H
|