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
{
@@ -84,7 +85,7 @@ namespace OpenNest.Geometry
/// <returns></returns>
public double Area()
{
return Math.PI * Radius * Radius;
return System.Math.PI * Radius * Radius;
}
/// <summary>
@@ -93,7 +94,7 @@ namespace OpenNest.Geometry
/// <returns></returns>
public double Circumference()
{
return Math.PI * Diameter;
return System.Math.PI * Diameter;
}
/// <summary>
@@ -131,8 +132,8 @@ namespace OpenNest.Geometry
var angle = stepAngle * i;
points.Add(new Vector(
Math.Cos(angle) * Radius + Center.X,
Math.Sin(angle) * Radius + Center.Y));
System.Math.Cos(angle) * Radius + Center.X,
System.Math.Sin(angle) * Radius + Center.Y));
}
return points;
@@ -290,8 +291,8 @@ namespace OpenNest.Geometry
var angle = Center.AngleTo(pt);
return new Vector(
Math.Cos(angle) * Radius + Center.X,
Math.Sin(angle) * Radius + Center.Y);
System.Math.Cos(angle) * Radius + Center.X,
System.Math.Sin(angle) * Radius + Center.Y);
}
/// <summary>
@@ -324,7 +325,7 @@ namespace OpenNest.Geometry
public override bool Intersects(Circle circle)
{
var dist = Center.DistanceTo(circle.Center);
return (dist < (Radius + circle.Radius) && dist > Math.Abs(Radius - circle.Radius));
return (dist < (Radius + circle.Radius) && dist > System.Math.Abs(Radius - circle.Radius));
}
/// <summary>