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 7067795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:14:42+00:00 2026-05-28T05:14:42+00:00

I am wondering if anyone here can help me with some pseudocode or at

  • 0

I am wondering if anyone here can help me with some pseudocode or at least point me in the right direction on how to draw a circle segment without anti-aliasing.

  • 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-05-28T05:14:43+00:00Added an answer on May 28, 2026 at 5:14 am

    The formula for points on a circle are:

    x = xcenter + radius * sin(theta)
    y = ycenter + radius * cos(theta)
    

    where xcenter and ycenter are the center of the circle, radius is the radius and theta is the angle.

    You simply have to iterate theta from your starting angle to your ending angle in small enough steps, and extract the x and y values for plotting, and keep in mind that most trigonometric functions take their arguments as radians (0 through 2*PI) rather than degrees (0 through 360) – adjust your start and end angles and your theta step to take this into account.

    Pseudo-code would be something like the following:

    def plotCirle (xc, yc, rad, start, end):
        theta = start
        while theta <= end:
            x = xc + rad * sin (theta)
            y = yc + rad * cos (theta)
            plot (x, y)
            theta = theta + 0.01
    

    although you’d probably want to normalise the angles to be between 0 and 2*PI, and then swap the start and end angles if the former is greater than the latter.

    If you want more efficient code, you can look into the midpoint circle algorithm. The math is heavier and it’s slightly complicated by the requirement that you only want a segment (meaning you’ll need to know the angle, something not usually necessary for this algorithm with a full circle) but that might be a good starting point if the simplistic algorithm above is not fast enough.

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

Sidebar

Related Questions

I'm wondering if anyone can help me out with some Canvas. I'm pretty new
I know I can get answers here but I was wondering if anyone knows
I was wondering if anyone here had some experience writing this type of script
Wondering if anyone can help me with this annoying but trivial (in terms of
Wondering if anyone can help me. I'm trying to put together a weekly photo
I am wondering if anyone can help me. After hours of searching tirelessly on
I have a few questions here if anyone can help me out. First off,
wondering if anyone might have some insight or point me to the proper documentation
Wondering if anyone can help me out. How can I line the content area
Hey, I'm having a strange issue. I'm wondering if anyone can help me make

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.