@adludio/geometry 中文文档教程
@adludio/geometry
青色的 2D 点和几何数学
Installation instruction
npm i --save @adludio/geometry
How to use
它基本上是一堆实用函数,您可以通过使用来包含它们:
import * as p from "@adludio/geometry/point"
p.point(5, 2) // {x: 5, y: 2}
或者如果您正在编写自己的具有 2D 几何功能的 TypeScript 库:
import { Point } from "@adludio/geometry/point"
function draw(ctx: CanvasContext, point: Point) {
ctx.rect(point.x, point.y)
ctx.fill("red")
ctx.draw()
}
即将推出:
Point
Anchor
Transform
Matrix
@adludio/geometry
2D point and geometry math for cyan
Installation instruction
npm i --save @adludio/geometry
How to use
It's basically a bunch of utility functions, that you can include by using:
import * as p from "@adludio/geometry/point"
p.point(5, 2) // {x: 5, y: 2}
or if you are writing your own TypeScript library with 2D Geometry features:
import { Point } from "@adludio/geometry/point"
function draw(ctx: CanvasContext, point: Point) {
ctx.rect(point.x, point.y)
ctx.fill("red")
ctx.draw()
}
Coming soon: