mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-21 21:38:52 +00:00
Began DrawCircle function
This commit is contained in:
parent
dda88d4e1f
commit
cbb2f4440a
1 changed files with 19 additions and 0 deletions
|
|
@ -84,6 +84,8 @@ namespace Cosmos.System.Graphics
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public abstract void DrawPoint(Pen pen, int x, int y);
|
||||
|
||||
public abstract void DrawPoint(Pen pen, float x, float y);
|
||||
|
|
@ -190,6 +192,23 @@ namespace Cosmos.System.Graphics
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DrawCircle(Pen pen, int x_center, int y_center, int radius)
|
||||
{
|
||||
if (pen == null)
|
||||
throw new ArgumentNullException(nameof(pen));
|
||||
|
||||
int r2 = radius * radius;
|
||||
|
||||
for (int i = 0; i <= radius; i++)
|
||||
{
|
||||
int xLocal = i;
|
||||
int xLocal2 = i * i;
|
||||
int yLocal2 = r2 - xLocal2;
|
||||
int yLocal = Math.Sqrt(yLocal2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void DrawRectangle(Pen pen, int x, int y, int width, int height)
|
||||
{
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue