Question: Define variables for Amplitude and frequency; C# code for Simple Harmonic Motion Question : Need help finishing this code for C# It is for simple

Define variables for Amplitude and frequency;

C# code for Simple Harmonic Motion

Question: Need help finishing this code for C# It is for simple harmonic motion( of a cube) in Visual Studio...

using System.collections. Generic;

using UnityEngine;

public class MoveObject : MonoBehaviour

{

publict float rotationalSpeed;//[degrees/sec]]

// Start is called before the first fram

void Start()

{

}

// Update is called once per frame

void Update()

{

// transform.Rotate(0.0f, rotational Speed*Time.deltaTime, 0.0f):

//

// move the cube in simple harmonic motion

// Hints

// explore the Mathf structure and use the Mathf.Cos() function

// use the transform.position property an define

// transform.position =new Vector3(A*Cos(2*pi*f*time), 0.5f, 0.0f);

// define variables for Amplitude an frequency

} }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!