KiCad PCB EDA Suite
Loading...
Searching...
No Matches
easypc_units.h File Reference

Design units of 100 nm and angles of thousandths of a degree, anticlockwise from +X with Y up. More...

#include <cmath>
#include <cstdint>
#include <limits>

Go to the source code of this file.

Namespaces

namespace  EASYPC
 

Functions

constexpr int64_t EASYPC::DsuToNm (int64_t aDsu)
 
constexpr double EASYPC::AngleToDegrees (int32_t aAngle)
 
constexpr int32_t EASYPC::NormalizeAngle (int32_t aAngle)
 Wrap an angle into [0, ANGLE_FULL_TURN)
 
void EASYPC::PointRotate (double aPx, double aPy, int32_t aAngle, double aCx, double aCy, int32_t &aOutX, int32_t &aOutY)
 Rotate aPx, aPy anticlockwise by aAngle about aCx, aCy as Easy-PC places points: in double with exact quarter turns, truncating toward zero, so the operand order of each sum decides the last bit.
 
void EASYPC::PointRotate (int32_t &aX, int32_t &aY, int32_t aAngle, int32_t aCx, int32_t aCy)
 

Variables

constexpr int64_t EASYPC::NM_PER_DSU = 100
 
constexpr int EASYPC::ANGLE_FULL_TURN = 360000
 
constexpr double EASYPC::COORD_LIMIT = std::numeric_limits<int>::max() / 2.0
 Half of KiCad's integer range, so shape code rotating or adding coordinates cannot overflow.
 

Detailed Description

Design units of 100 nm and angles of thousandths of a degree, anticlockwise from +X with Y up.

Definition in file easypc_units.h.