Snap.path.findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t)
优质
小牛编辑
128浏览
2023-12-01
Utility method Finds dot coordinates on the given cubic beziér curve at the given t
Parameters
- p1xnumberx of the first point of the curve
- p1ynumbery of the first point of the curve
- c1xnumberx of the first anchor of the curve
- c1ynumbery of the first anchor of the curve
- c2xnumberx of the second anchor of the curve
- c2ynumbery of the second anchor of the curve
- p2xnumberx of the second point of the curve
- p2ynumbery of the second point of the curve
- tnumberposition on the curve (0..1)
Returns: object point information in format:
- {
- x: numberx coordinate of the point,
- y: numbery coordinate of the point,
- m: {
- x: number x coordinate of the left anchor,
- y: number y coordinate of the left anchor
- },
- n: {
- x: number x coordinate of the right anchor,
- y: number y coordinate of the right anchor
- },
- start: {
- x: number x coordinate of the start of the curve,
- y: number y coordinate of the start of the curve
- },
- end: {
- x: number x coordinate of the end of the curve,
- y: number y coordinate of the end of the curve
- },
- alpha: numberangle of the curve derivative at the point
- }