2DLightPathSimulator/ImplementationTest/Program.cs

46 lines
1.1 KiB
C#
Raw Normal View History

2023-06-06 22:56:56 +00:00
// See https://aka.ms/new-console-template for more information
using System.Diagnostics;
using LensSimulatorCore;
using LensSimulatorCore.Optical;
using LensSimulatorCore.Shapes;
using LensSimulatorCore.Workspace;
var ellipse = new Ellipse(0.2,3,4,new Point(1,3));
var result = ellipse.GetIntersectionPoints(new Line(-2, 3));
var ListOfPointsOnCircle = (double n) =>
{
List<Point> points = new List<Point>();
for (int i = 0; i < n; i++)
{
var radians = Math.PI * 2 / n * i;
var x = Math.Cos(radians);
var y = Math.Sin(radians);
points.Add(new Point(x, y));
}
return points;
};
var test = ListOfPointsOnCircle(8);
var sellmeier = new SellmeierCoefficients(1.03961212, 0.00600069867, 0.231792344, 0.0200179144, 0, 103);
var material = new Material(sellmeier);
var s = new Stopwatch(); s.Start();
var reflectivity = material.Reflectivity(45, 1.00027717, 450);
var transmissivity = material.Transmissivity(45, 1.00027717, 450);
s.Stop();
var time = s.ElapsedMilliseconds;
Console.Write("F");