# 2D kinematics

I am trying to make a calculator and for some reason the time is not showing right. Am I doing something wrong with my equations? I get 1.73 and the online calculator gets 1.44... My angle is 45 degrees and my velocity is 10 m/s

```
vx = float.Parse(velocity.text) * Mathf.Cos(float.Parse(angle.text));
vy = float.Parse(velocity.text) * Mathf.Sin(float.Parse(angle.text));
time = ((2 * vy) / g);
distance = vx * time;
print(time);
```

Mathf.Cos/Sin/Tan take an argument in radians, you can multiply by Mathf.Deg2Rad;

**Answer** by elenzil
·
Apr 04, 2018 at 07:34 PM

sin() and cos() take in radians, not degrees.

so this:

```
Mathf.Cos(float.Parse(angle.text))
```

should be this:

```
Mathf.Cos(Mathf.Deg2Rad * float.Parse(angle.text))
```

.. and similar for Sin() as well.

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

What is the parabolic formula for a 2D projectile's trajectory 1 Answer

In what way do units matter when providing density for Collider2Ds? 0 Answers

How to make flips, backflips like in game Backflip madness 2 Answers

GameObject with multiple collider2D, 1 Answer

Adding velocity to an object in a brick breaker game 0 Answers