mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use string.EndsWith(string, StringComparison.
This commit is contained in:
@@ -620,11 +620,11 @@ public sealed class Spiral : IMediaGraph
|
|||||||
/// <param name="center">Center of the spiral start</param>
|
/// <param name="center">Center of the spiral start</param>
|
||||||
/// <param name="minRadius">Minimum radius before which the spiral must have no points</param>
|
/// <param name="minRadius">Minimum radius before which the spiral must have no points</param>
|
||||||
/// <param name="maxRadius">Radius at which the spiral will end</param>
|
/// <param name="maxRadius">Radius at which the spiral will end</param>
|
||||||
/// <param name="a">TODO: Something trigonometry something something...</param>
|
/// <param name="a">A constant that decides the position of a point on the spiral</param>
|
||||||
/// <returns>List of points to draw the specified spiral</returns>
|
/// <returns>List of points to draw the specified spiral</returns>
|
||||||
static List<SKPoint> GetSpiralPoints(SKPoint center, float minRadius, float maxRadius, float a)
|
static List<SKPoint> GetSpiralPoints(SKPoint center, float minRadius, float maxRadius, float a)
|
||||||
{
|
{
|
||||||
// Get the points.
|
// Initialize a list to store the points of the spiral.
|
||||||
List<SKPoint> points = new();
|
List<SKPoint> points = new();
|
||||||
const float dtheta = (float)(0.5f * Math.PI / 180);
|
const float dtheta = (float)(0.5f * Math.PI / 180);
|
||||||
|
|
||||||
@@ -636,18 +636,18 @@ public sealed class Spiral : IMediaGraph
|
|||||||
if(r < minRadius)
|
if(r < minRadius)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Convert to Cartesian coordinates.
|
// Converts polar coordinates (r,theta) to Cartesian (x,y)
|
||||||
var x = (float)(r * Math.Cos(theta));
|
var x = (float)(r * Math.Cos(theta));
|
||||||
var y = (float)(r * Math.Sin(theta));
|
var y = (float)(r * Math.Sin(theta));
|
||||||
|
|
||||||
// Center.
|
// Adjusts x and y by center coordinates
|
||||||
x += center.X;
|
x += center.X;
|
||||||
y += center.Y;
|
y += center.Y;
|
||||||
|
|
||||||
// Create the point.
|
// Adds the newly calculated point to the list
|
||||||
points.Add(new SKPoint(x, y));
|
points.Add(new SKPoint(x, y));
|
||||||
|
|
||||||
// If we have gone far enough, stop.
|
// Terminate the loop if we have reached the end of the spiral
|
||||||
if(r > maxRadius)
|
if(r > maxRadius)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule Aaru.Decoders updated: 11131ce825...089ba52732
Submodule Aaru.Decryption updated: 24557e80cd...7fd2a0fc73
Reference in New Issue
Block a user