Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@visx/point

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@visx/point

visx point

  • 3.12.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
430K
increased by7.48%
Maintainers
4
Weekly downloads
 
Created

What is @visx/point?

@visx/point is a utility library for working with 2D points in JavaScript. It provides a simple Point class that can be used to represent and manipulate points in a 2D space, making it useful for various graphical and data visualization tasks.

What are @visx/point's main functionalities?

Creating a Point

This feature allows you to create a new Point object with specified x and y coordinates.

const { Point } = require('@visx/point');
const point = new Point(10, 20);
console.log(point); // Point { x: 10, y: 20 }

Manipulating Points

This feature allows you to perform arithmetic operations on points, such as adding two points together.

const { Point } = require('@visx/point');
const point1 = new Point(10, 20);
const point2 = new Point(5, 5);
const sum = point1.add(point2);
console.log(sum); // Point { x: 15, y: 25 }

Distance Between Points

This feature allows you to calculate the Euclidean distance between two points.

const { Point } = require('@visx/point');
const point1 = new Point(10, 20);
const point2 = new Point(13, 24);
const distance = point1.distance(point2);
console.log(distance); // 5

Other packages similar to @visx/point

Keywords

FAQs

Package last updated on 07 Nov 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc