Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
using RobotNet10.Shared.Numbers;
namespace RobotNet10.Shared.Geometry;
public static class GeometryExtensions
{
extension(Quaternion q)
{
public double ToYawRadian()
{
var sinYaw = 2.0 * (q.W * q.Z + q.X * q.Y);
var cosYaw = 1.0 - 2.0 * (q.Y * q.Y + q.Z * q.Z);
return Math.Atan2(sinYaw, cosYaw);
}
public double ToYawDegrees() => q.ToYawRadian() * 180 / Math.PI;
}
}