Commit 249733ca authored by Chae Ho Shin's avatar Chae Ho Shin

linear acceleration

parent 1a51c946
......@@ -7,6 +7,8 @@ public class Planemovement : MonoBehaviour
//bool toggle = true;
int cnt = 0;
double beta = 0.5f; // v/c
Vector3 alpha = new Vector3(0.1f, 0.0f, 0.0f); // proper acceleration
Vector3 v;
// Start is called before the first frame update
public GameObject theobject;
......@@ -17,6 +19,7 @@ public class Planemovement : MonoBehaviour
Renderer r = theobject.GetComponent<Renderer>();
//Color materialColor = r.material.color;
r.material.color = Color.blue;
v = new Vector3(0.0f, 0.0f, 0.0f);
}
// Update is called once per frame
......@@ -36,7 +39,13 @@ public class Planemovement : MonoBehaviour
//transform.Translate(0.5f*Vector3.forward * Mathf.Cos(2*Mathf.PI*cnt/480) * Time.fixedDeltaTime, Space.World);
//transform.Translate(0.5f*Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480) * Time.fixedDeltaTime, Space.World);
var v = (float)beta * Vector3.forward * Mathf.Cos(2 * Mathf.PI * cnt / 480) + (float)beta * Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480);
//var v = (float)beta * Vector3.forward * Mathf.Cos(2 * Mathf.PI * cnt / 480) + (float)beta * Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480);
v = alpha.normalized * (alpha.magnitude * Time.time / Mathf.Sqrt(1.0f+(alpha.magnitude * Time.time)*(alpha.magnitude * Time.time)));
Debug.Log(v.ToString("F6"));
beta = v.magnitude / 1.0f;
double gamma = 1.0f / Mathf.Sqrt(1.0f - (float)(beta*beta));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment