2DLightPathSimulator/ImplementationTest/Program.cs

54 lines
1.4 KiB
C#
Raw Permalink 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.Optical;
using LensSimulatorCore.Shapes;
2023-06-07 19:16:35 +00:00
namespace ImplementationTest;
2023-06-06 22:56:56 +00:00
2023-06-07 19:16:35 +00:00
internal class Program
2023-06-06 22:56:56 +00:00
{
2023-06-07 19:16:35 +00:00
static void Main(string[] args)
2023-06-06 22:56:56 +00:00
{
2023-06-07 19:16:35 +00:00
var ellipse = new Ellipse(-0.6,1.8,1.4,new Point(2.1,-0.5));
var resultEllipse = ellipse.GetIntersectionPoints(new Line(3.7, 2.8));
var circle = new Circle(1.4, new Point(2.1, -0.5));
var resultCircle = circle.GetIntersectionPoints(new Line(3.7, 2.8));
2023-06-07 19:32:11 +00:00
2023-06-07 19:16:35 +00:00
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));
}
2023-06-06 22:56:56 +00:00
2023-06-07 19:16:35 +00:00
return points;
};
2023-06-06 22:56:56 +00:00
2023-06-07 19:16:35 +00:00
var test = ListOfPointsOnCircle(8);
2023-06-06 22:56:56 +00:00
2023-06-07 19:16:35 +00:00
var sellmeier = new SellmeierCoefficients(1.03961212, 0.00600069867, 0.231792344, 0.0200179144, 0, 103);
2023-06-06 22:56:56 +00:00
2023-06-07 19:16:35 +00:00
var material = new Material(sellmeier);
2023-06-06 22:56:56 +00:00
2023-06-07 19:16:35 +00:00
var s = new Stopwatch(); s.Start();
2023-06-06 22:56:56 +00:00
2023-06-07 19:16:35 +00:00
var reflectivity = material.Reflectivity(45, 1.00027717, 450);
var transmissivity = material.Transmissivity(45, 1.00027717, 450);
2023-06-06 22:56:56 +00:00
2023-06-07 19:16:35 +00:00
s.Stop();
var time = s.ElapsedMilliseconds;
2023-06-06 22:56:56 +00:00
2023-06-07 19:16:35 +00:00
Console.Write("F");
}
}