
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@tscircuit/math-utils
Advanced tools
This repository contains a collection of TypeScript utility functions for geometric calculations, primarily focused on line intersection and distance calculations.
This repository contains a collection of TypeScript utility functions for geometric calculations, primarily focused on line intersection and distance calculations.
bun add @tscircuit/math-utils
Import the functions you need in your TypeScript project:
import {
doesLineIntersectLine,
doSegmentsIntersect,
pointToSegmentDistance,
} from "./src/index"
// Example usage
const point1 = { x: 0, y: 0 }
const point2 = { x: 5, y: 5 }
const point3 = { x: 0, y: 5 }
const point4 = { x: 5, y: 0 }
const intersects = doesLineIntersectLine([point1, point2], [point3, point4])
console.log("Lines intersect:", intersects)
doesLineIntersectLine(line1: [Point, Point], line2: [Point, Point], options?: { lineThickness?: number }): boolean
Determines if two lines intersect, optionally considering line thickness.
doSegmentsIntersect(p1: Point, q1: Point, p2: Point, q2: Point): boolean
Checks if two line segments intersect.
orientation(p: Point, q: Point, r: Point): number
Calculates the orientation of three points.
onSegment(p: Point, q: Point, r: Point): boolean
Checks if point q lies on the segment p-r.
pointToSegmentDistance(p: Point, v: Point, w: Point): number
Calculates the minimum distance between a point and a line segment.
distance(p1: Point, p2: Point): number
Calculates the Euclidean distance between two points.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
FAQs
This repository contains a collection of TypeScript utility functions for geometric calculations, primarily focused on line intersection and distance calculations.
The npm package @tscircuit/math-utils receives a total of 20,622 weekly downloads. As such, @tscircuit/math-utils popularity was classified as popular.
We found that @tscircuit/math-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.