Android 工具类(获得两点连线的中点)

版权声明:版权声明:本文为博主原创文章,未经博主允许不得转载,违者必究。 https://blog.csdn.net/Cricket_7/article/details/89321576
/**
	 * Get middle point between p1 and p2.
	 * 获得两点连线的中点
	 * @param p1
	 * @param p2
	 * @return
	 */
	public static PointF getMiddlePoint(PointF p1, PointF p2) {
		return new PointF((p1.x + p2.x) / 2.0f, (p1.y + p2.y) / 2.0f);
	}

 

猜你喜欢

转载自blog.csdn.net/Cricket_7/article/details/89321576
0条评论
添加一条新回复