二点の中点
二点の中点
using UnityEngine;
using System.Collections;
public class CenterPoint : MonoBehaviour
{
Vector3 a, b; void Start () { a = new Vector3 (1, 1, 1); b = new Vector3 (-5, -5, -5); Vector3 center = new Vector3 ((a.x + b.x) / 2, (a.y + b.y) / 2, (a.z + b.z) / 2); print (a + " / " + b + " : Center : " + center); }
}
- 最終更新:2013-11-22 15:40:16