45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using LeoTurtle;
|
|
|
|
namespace PinwheelTiling;
|
|
|
|
public static class PinwheelTilingPath
|
|
{
|
|
private const double Alpha = 26.57D;
|
|
private const double Beta = 90D - Alpha;
|
|
private const double Gamma = 90D;
|
|
|
|
/// <summary>
|
|
/// Executes the logic for adding turtle path steps.
|
|
/// Called automatically when application starts.
|
|
/// </summary>
|
|
/// <param name="turtle">The <see cref="SmartTurtle"/> instance to use</param>
|
|
public static void Walk(SmartTurtle turtle)
|
|
{
|
|
var initialTriangle = new Triangle(new Point(2.5D, 10.0D), new Point(82.5D, 50.0D), new Point(82.5D, 10.0D));
|
|
|
|
// TODO - call your drawing/subdivision method
|
|
}
|
|
|
|
// TODO - implement your algorithm
|
|
|
|
/// <summary>
|
|
/// Converts an angel from degrees to radians.
|
|
/// </summary>
|
|
/// <param name="angleDegrees">Degrees to convert</param>
|
|
/// <returns>Radians value</returns>
|
|
private static double ConvertToRadians(double angleDegrees)
|
|
{
|
|
return angleDegrees * Math.PI / 180D;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Calculates the distance between two points.
|
|
/// </summary>
|
|
/// <param name="a">First point</param>
|
|
/// <param name="b">Second point</param>
|
|
/// <returns>Distance between the two points</returns>
|
|
private static double DistanceBetweenPoints(Point a, Point b)
|
|
{
|
|
return Math.Sqrt(Math.Pow(b.X - a.X, 2D) + Math.Pow(b.Y - a.Y, 2D));
|
|
}
|
|
}
|