easy-util-tools
  • 👋Welcome to easy-util-tools
  • baseClass(基本类)
    • Color(颜色)
    • Point(点)
    • Line(线)
    • Circle(圆)
    • Rectangle(矩形)
    • Gradient(渐变色)
    • TimeMonitoring(时间统计)
  • utils(工具)
    • formatAmount(格式金额)
    • getStandardCoordinate
Powered by GitBook
On this page
  1. baseClass(基本类)

Point(点)

// Import the class
import { Point } from 'easy-util-tools'

//The Instantiate Class parameter is a two-dimensional coordinate  x, y
let point = new Point(0, 0)
/**
* 获取到点的距离
* Gets the distance to the point
* @param point
*/
 let distance=point.getDistanceToPoint(point);
/**
 *  判断点是否在当前这个点的范围内
 *  Determine whether the point is within the range of the current point
 * @param point
 * @param radius
 * @param type 'round'|'square'
 */
 let inArea = point.isPointInArea(point, radius, type);
/**
* 获取到线的距离
* Gets the distance to the line
* @param line
*/
let distance = point.getDistanceToLine(line);
/**
* 获取距离最近的点
* Gets the point closest to the distance
* @param points
*/
let info = point.getClosestPoint(points)
PreviousColor(颜色)NextLine(线)

Last updated 2 years ago