using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//利用球画圆
public class NewBehaviourScript1 : MonoBehaviour {
public GameObject sphere;
// Use this for initialization
void Start () {
Debug.Log(Mathf.Sin(Mathf.PI / 6));//正确用法
int count = 9;//每四分之一段数
int radius = 1;//半径
for (int i = 0; i <= count; i++)
{
GameObject go = Instantiate(sphere);
go.transform.position = new Vector3(Mathf.Cos(Mathf.PI/2/count*i), Mathf.Sin(Mathf.PI / 2 / count * i), 0)* radius;
GameObject go1 = Instantiate(sphere);
go1.transform.position = new Vector3(-Mathf.Cos(Mathf.PI / 2 / count * i), Mathf.Sin(Mathf.PI / 2 / count * i), 0) * radius;
GameObject go2 = Instantiate(sphere);
go2.transform.position = new Vector3(Mathf.Cos(Mathf.PI / 2 / count * i), -Mathf.Sin(Mathf.PI / 2 / count * i), 0) * radius;
GameObject go3 = Instantiate(sphere);
go3.transform.position = new Vector3(-Mathf.Cos(Mathf.PI / 2 / count * i), -Mathf.Sin(Mathf.PI / 2 / count * i), 0) * radius;
}
}
// Update is called once per frame
void Update () {
}
}