题目链接:HDU 1700 Problem Description There is a cycle with its center on the origin. Now give you a point on the cycle, you are to find out the other two points on it, to maximize the sum of the distance between each other you may assume that the radius
http://acm.hdu.edu.cn/showproblem.php?pid=1700 Points on Cycle Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1567 Accepted Submission(s): 570 Problem Description There is a cycle with its c
当初弄不明白旋转..居然找不到资料四元数应该用轴角相乘...后来自己摸明白了 通过两种旋转的配合,可以告别世界空间和本地空间矩阵转换了,大大提升效率. 每个轴相乘即可,可以任意轴,无限乘.无万向节锁问题 四元数旋转: using UnityEngine; using System.Collections; public class RotationTest : MonoBehaviour { public float x, y, z; void Start () { } void Update
乒乓球以一个向量运动,碰到障碍后反弹以一个新的向量运动,如下图: 要实现回弹只需要求出向量v1,把向量v0取反,再旋转(a+b)度就可以得到向量v1. 向量取反: var v:vec2 = new Vec2(10,10); v.x = -v.x; v.y = -v.y; //或者 v=v.mul(-1); 坐标旋转: var v:Vec2 = new Vec2(10,10); v.rotate(Math.PI);//以弧度为单位 //rotate方法的实现 public function rot