Question
Need help finishing this code for C# It is for simple harmonic motion( of a cube in Visual Studio), I have typed in some of
Need help finishing this code for C#
It is for simple harmonic motion( of a cube in Visual Studio), I have typed in some of it but last part is not finished....
using System.collections;
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started