示例#1
0
文件: point.go 项目: smyrman/units
// Div returns the quotient of p / k as a new Point.
func (p Point) Div(k float64) Point {
	return Point{p.X / linear.Distance(k), p.Y / linear.Distance(k)}
}
示例#2
0
文件: point.go 项目: smyrman/units
// Mul returns the product of p * k as a new Point.
func (p Point) Mul(k float64) Point {
	return Point{p.X * linear.Distance(k), p.Y * linear.Distance(k)}
}