Socket
Book a DemoInstallSign in
Socket

@zubry/boundary

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zubry/boundary

Boundary module

1.0.6
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Boundary

Contains BoundingCircle and BoundingRectangle. Exports BoundingRectangle by default.

Installation

npm install @zubry/boundary --save

Usage

import Boundary from '@zubry/boundary'; // imports BoundingRectangle
import { BoundingRectangle, BoundingCircle } from '@zubry/boundary'; // imports both classes

Examples

const rect = new BoundingRectangle({ center: new Position(5, 5), rotation: new Position(45), height: 10, width: 5 });

const circle = new BoundingCircle({ center: new Position(5, 5), radius: 10 });

API

Both classes have the same API

shift(amount)

Shifts the boundary by the given amount (position)

scale(amount)

Scales the boundary by the given amount (scalar)

rotate(amount)

Rotates the boundary by the given amount (angle/position)

intersects(boundary)

Checks if the boundary intersects the given boundary

area()

Returns the area of the boundary

FAQs

Package last updated on 21 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.