UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::CADKernel::Slope Namespace Reference

Variables

constexpr double NullSlope = 0.
 
constexpr double RightSlope = 2.
 
constexpr double HalfPiSlope = 2.
 
constexpr double NinetySlope = 2.
 
constexpr double ThreeRightSlope = 6.
 
constexpr double MinusRightSlope = -2.
 
constexpr double PiSlope = 4.
 
constexpr double TwoPiSlope = 8.
 
constexpr double ThirdPiSlope = 1.422649730810374235490851219498
 
constexpr double SixtySlope = 1.422649730810374235490851219498
 
constexpr double QuaterPiSlope = 1
 
constexpr double FortyFiveSlope = 0.57735026918962576450914878050196
 
constexpr double SixthPiSlope = 0.57735026918962576450914878050196
 
constexpr double ThirtySlope = 0.57735026918962576450914878050196
 
constexpr double ThreeQuaterPiSlope = 3
 
constexpr double OneDegree = 0.01745506492821758576512889521973
 
constexpr double TwoDegree = 0.03492076949174773050040262577373
 
constexpr double FiveDegree = 0.08748866352592400522201866943496
 
constexpr double TenDegree = 0.17632698070846497347109038686862
 
constexpr double FifteenDegree = 0.26794919243112270647255365849413
 
constexpr double TwentyDegree = 0.36397023426620236135104788277683
 
constexpr double TwentyFiveDegree = 0.46630765815499859283000619479956
 
constexpr double Epsilon = 0.001
 

Detailed Description

"Slope" is a fast angle approximation.

This file propose all useful methods to use slope instead of angle.

The method "ComputeSlope(const FVector2d& StartPoint, const FVector2d& EndPoint) is the main method. It compute the slope between the input segment defined by two points and [0, u) axis. The return value is a real in the interval [0, 8] for an angle in the interval [0, 2Pi]

Warning, it's only an approximation... The conversion is not linear but the error is small near the integer value of slope (0, 1, 2, 3, ...8)

To compute an angle value between two segments, the call of acos (and asin for an oriented angle) is necessary while with this approximation, only a division is useful.

This approximation is very good when only comparison of angles is needed and more faster than acos and/or asin i.e. Slope approximation need only a division and few addition and test

[0 - 2Pi] is divide into 8 angular sector i.e. [0, Pi/4] = [0,1], [Pi/4, Pi/2] = [1,2], ...

The value of the slope for an angle in [0, Pi/4] = tan(angle)

Returns
a slope between [0, 8] i.e. an equivalent angle between [0, 2Pi]

Angle (Degree) to Slop 0 = 0 1 ~ 0.0175 2 ~ 0.035 5 ~ 0.0875 10 ~ 0.176

  1. ~ 0.268 20 ~ 0.364 25 ~ 0.466 30 ~ 0.577 45 = 1 60 ~ 1.423 == 2 - Slope(30) 90 = 2 120 ~ 2.577 == 2 + Slope(30) 135 = 3 180 = 4 360 = 8

Variable Documentation

◆ Epsilon

constexpr double UE::CADKernel::Slope::Epsilon = 0.001
constexpr

◆ FifteenDegree

constexpr double UE::CADKernel::Slope::FifteenDegree = 0.26794919243112270647255365849413
constexpr

◆ FiveDegree

constexpr double UE::CADKernel::Slope::FiveDegree = 0.08748866352592400522201866943496
constexpr

◆ FortyFiveSlope

constexpr double UE::CADKernel::Slope::FortyFiveSlope = 0.57735026918962576450914878050196
constexpr

◆ HalfPiSlope

constexpr double UE::CADKernel::Slope::HalfPiSlope = 2.
constexpr

◆ MinusRightSlope

constexpr double UE::CADKernel::Slope::MinusRightSlope = -2.
constexpr

MinusRightSlope i.e. -Pi / 2

◆ NinetySlope

constexpr double UE::CADKernel::Slope::NinetySlope = 2.
constexpr

◆ NullSlope

constexpr double UE::CADKernel::Slope::NullSlope = 0.
constexpr

◆ OneDegree

constexpr double UE::CADKernel::Slope::OneDegree = 0.01745506492821758576512889521973
constexpr

◆ PiSlope

constexpr double UE::CADKernel::Slope::PiSlope = 4.
constexpr

PiSlope i.e. Pi angle

◆ QuaterPiSlope

constexpr double UE::CADKernel::Slope::QuaterPiSlope = 1
constexpr

ThirdPiSlope i.e. Pi/4 angle (45 deg)

◆ RightSlope

constexpr double UE::CADKernel::Slope::RightSlope = 2.
constexpr

RightSlope i.e. Right angle i.e Pi / 2

◆ SixthPiSlope

constexpr double UE::CADKernel::Slope::SixthPiSlope = 0.57735026918962576450914878050196
constexpr

ThirdPiSlope i.e. Pi/6 angle (30 deg)

◆ SixtySlope

constexpr double UE::CADKernel::Slope::SixtySlope = 1.422649730810374235490851219498
constexpr

◆ TenDegree

constexpr double UE::CADKernel::Slope::TenDegree = 0.17632698070846497347109038686862
constexpr

◆ ThirdPiSlope

constexpr double UE::CADKernel::Slope::ThirdPiSlope = 1.422649730810374235490851219498
constexpr

ThirdPiSlope i.e. Pi/3 angle (60 deg)

◆ ThirtySlope

constexpr double UE::CADKernel::Slope::ThirtySlope = 0.57735026918962576450914878050196
constexpr

◆ ThreeQuaterPiSlope

constexpr double UE::CADKernel::Slope::ThreeQuaterPiSlope = 3
constexpr

ThreeQuaterPiSlope i.e. 3Pi/4 angle (135 deg)

◆ ThreeRightSlope

constexpr double UE::CADKernel::Slope::ThreeRightSlope = 6.
constexpr

ThreeRightSlope i.e. 3Pi / 2

◆ TwentyDegree

constexpr double UE::CADKernel::Slope::TwentyDegree = 0.36397023426620236135104788277683
constexpr

◆ TwentyFiveDegree

constexpr double UE::CADKernel::Slope::TwentyFiveDegree = 0.46630765815499859283000619479956
constexpr

◆ TwoDegree

constexpr double UE::CADKernel::Slope::TwoDegree = 0.03492076949174773050040262577373
constexpr

◆ TwoPiSlope

constexpr double UE::CADKernel::Slope::TwoPiSlope = 8.
constexpr

PiSlope i.e. Pi angle