Auios.Rectangle 1.0.1

A pretty nifty Rectangle.

Install-Package Auios.Rectangle -Version 1.0.1
dotnet add package Auios.Rectangle --version 1.0.1
<PackageReference Include="Auios.Rectangle" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Auios.Rectangle --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Auios.Rectangle, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Auios.Rectangle as a Cake Addin
#addin nuget:?package=Auios.Rectangle&version=1.0.1

// Install Auios.Rectangle as a Cake Tool
#tool nuget:?package=Auios.Rectangle&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Auios.Rectangle

namespace Auios.Rectangle
{
    public class Rectangle
    {
        public float X;
        public float Y;
        public float Width;
        public float Height;
        public float Top => Y;
        public float Bottom => Y + Height;
        public float Left => X;
        public float Right => X + Width;
        public float HalfWidth => Width * 0.5f;
        public float HalfHeight => Height * 0.5f;
        public float CenterX => X + HalfWidth;
        public float CenterY => Y + HalfHeight;

        public Rectangle(float x, float y, float width, float height)
        {
            X = x;
            Y = y;
            Width = width;
            Height = height;
        }

        public bool Contains(float x, float y)
        {
            if (x < Left || x > Right) return false;
            if (y < Top || y > Bottom) return false;
            return true;
        }
    }
}

Auios.Rectangle

namespace Auios.Rectangle
{
    public class Rectangle
    {
        public float X;
        public float Y;
        public float Width;
        public float Height;
        public float Top => Y;
        public float Bottom => Y + Height;
        public float Left => X;
        public float Right => X + Width;
        public float HalfWidth => Width * 0.5f;
        public float HalfHeight => Height * 0.5f;
        public float CenterX => X + HalfWidth;
        public float CenterY => Y + HalfHeight;

        public Rectangle(float x, float y, float width, float height)
        {
            X = x;
            Y = y;
            Width = width;
            Height = height;
        }

        public bool Contains(float x, float y)
        {
            if (x < Left || x > Right) return false;
            if (y < Top || y > Bottom) return false;
            return true;
        }
    }
}

  • .NETCoreApp 3.1

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Auios.Rectangle:

Package Downloads
Auios.QuadTree
Generic QuadTree algorithm inspired by Leonidovia's Ultimate QuadTree.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 186 10/31/2020
1.0.0 126 10/31/2020