Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8933201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:29:00+00:00 2026-06-15T09:29:00+00:00

This is for a computer science assignment using Python, does anybody know where I

  • 0

This is for a computer science assignment using Python, does anybody know where I would begin to create an algorithm to create a square or box that rolls across the screen? And I do indeed mean roll, not slide. It does not necessarily have to be using python, I just need a general idea as to how the coordinates would work and a general algorithm.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:29:01+00:00Added an answer on June 15, 2026 at 9:29 am

    If a unit square starts out with one side resting on the x-axis, and the lower right corner at (xs, 0), then after a quarter turn clockwise it will again have one side resting on the x-axis, and the lower right corner now at (xs+1, 0). Before it turns, label the lower left corner a; the upper left, b; and the upper right, c. Corners a and c move along arcs of a unit circle as the square turns. Corner b moves with radius d = sqrt(2).

    This leads to the following method: Step angle t from 0 to pi/2 (ie 90°), letting
    • xa = xs – cos t
    • ya = sin t
    • xb = xs – d*cos(t+pi/4)
    • yb = d*sin(t+pi/4)
    • xc = xs + sin t
    • yc = cos t

    At each time step, erase the old square by drawing background-colored lines, compute new (xa,ya,xb,yb,xc,yc) from equations, draw new square with lines from (xs,0) to (xa,yb) to (xc,yc) to (xd,yd) to (xs,0), and then delay appropriate amount. Each time t gets up to pi/2, set t back to 0 and add 1 to xs. Note, instead of erasing the whole square and then drawing the new, one might try erasing one old line and drawing one new line in turn for the four sides.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'll be taking a Python-based computer science class next semester using my MacBook Pro.
I'm in University studying computer science. This is actually my first big assignment but
So, I have this true/false question in my computer science class (we're using Java):
I'm a computer science teacher trying to create a little gradebook for myself using
I am new in this community. I just completed my Btech in Computer science,
I have turned computer monitor off using this command SendMessage(f.Handle, WM_SYSCOMMAND, (IntPtr)SC_MONITORPOWER, (IntPtr)(turnOff ?
I the following assignment due in a few days in my AP Computer Science
This question may seem rather basic, but coming from an engineering (non computer-science) background,
I'm currently doing a Java assignment as a computer science fresher. As a part
I'm enrolled in a masters computer science course. The course is using C and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.