Discussions

SmileBASIC Community

PChickenNerdChicken

12/01/2016 6:41 AM ·Spoilers

Open Closed

How to calculate a rotation° from the circle pad?

wats the formula, i won't learn any of this math until i'm at least in highschool.

Advertisement

Comment

This post has no comments.

  • the angle the circle pad is pointing is given by: STICK OUT SX#,SY# ANGLE#=ATAN(SY#,SX#) the #s after the variable names means they're realtypes. depending on your code they may or may not be there, it's just how I write it. Keep in mind Y comes first in ATAN. Angle is returned in RADIANS not degrees. 0° is stick pointing left, 90° is up, and so on.

    Yeahs1
    Played
  • Like Alex says, angle is returned in radian with his method. If you want to get angle in degree, write "DEG(ATAN(SY#,SX#))" instead of "ATAN(SY#,SX#)". Angle is 0deg when stick is pointing right. The maximum (minimum) angle is +180deg (-180deg) if you turn stick counterclockwise (clockwise) from 0deg position.

    Yeahs0
  • thanks!

    Yeahs1
    Played

Add a Comment

You must sign in to post a comment.

Sign in using a Nintendo Network ID to connect to users around the world by writing posts and comments and by giving Yeahs to other people's posts. You can create a Nintendo Network ID using your Wii U console or your system in the Nintendo 3DS family.

Use of Miiverse Details about Miiverse

Report Violation to Miiverse Administrators

You are about to report a post with content which violates the Miiverse Code of Conduct. This report will be sent to Nintendo's Miiverse administrators and not to the creator of the post.

Violation Type:

Post ID: 3DB-NBL7-EJ9-9E2N-8TU-872E

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: