Move math utilities to OpenNest.Math namespace

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 12:51:16 -05:00
parent 2210f60656
commit 8d9aebb83f
40 changed files with 172 additions and 140 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using OpenNest.Math;
namespace OpenNest.Geometry
{
@@ -219,7 +220,7 @@ namespace OpenNest.Geometry
{
var m1 = Slope();
var m2 = line.Slope();
return Math.Atan(Math.Abs((m2 - m1) / (1 + m2 * m1)));
return System.Math.Atan(System.Math.Abs((m2 - m1) / (1 + m2 * m1)));
}
/// <summary>
@@ -252,7 +253,7 @@ namespace OpenNest.Geometry
{
var x = EndPoint.X - StartPoint.X;
var y = EndPoint.Y - StartPoint.Y;
return Math.Sqrt(x * x + y * y);
return System.Math.Sqrt(x * x + y * y);
}
}
@@ -391,10 +392,10 @@ namespace OpenNest.Geometry
public override Entity OffsetEntity(double distance, OffsetSide side)
{
var angle = OpenNest.Angle.NormalizeRad(Angle() + OpenNest.Angle.HalfPI);
var angle = OpenNest.Math.Angle.NormalizeRad(Angle() + OpenNest.Math.Angle.HalfPI);
var x = Math.Cos(angle) * distance;
var y = Math.Sin(angle) * distance;
var x = System.Math.Cos(angle) * distance;
var y = System.Math.Sin(angle) * distance;
var pt = new Vector(x, y);