Skip to content

Calculation to generate wheel rotation #1

@fanjavaid

Description

@fanjavaid

Hello, thank you for sharing this project. Could you explain what calculation is it?

int corner = 360/38; // corner for point
int randPosition = corner * new Random().nextInt(38); // random point
int MIN = 5; // min rotation
int MAX = 9; // max rotation
long TIME_IN_WHEEL = 2000;  // time in one rotation
int randRotation = MIN + new Random().nextInt(MAX-MIN); // random rotation
int truePosition =  randRotation * 360 + randPosition;
long totalTime = TIME_IN_WHEEL * randRotation + (TIME_IN_WHEEL/360) * randPosition;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions