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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:43:32+00:00 2026-06-11T14:43:32+00:00

Using HTML5 Canvas and Javascript I need to display different values (represented by a

  • 0

Using HTML5 Canvas and Javascript I need to display different values (represented by a dot maybe) at different angles inside a circle.

Example data:
val 34% @ 0°,
val 54% @ 12°,
val 23% @ 70°,
and so on…

If I have a canvas 300 x 300px and the center of the circle is located at x: 150px and y: 150px with a radius of 150px, how would I calculate where to set my dot for the value 54% at 12 degrees?

My math is kinda terrible xD

I’d appreciate any kind of help and please ask questions if I do not make myself clear enough.

Thank you for listening and thank you in advance for you deep insights 😀

EDIT (to explain in more detail):

Here is an image to illustrate what I am trying to accomplish:
Illustration: values at different angles/degrees

I hope this makes my question a little more understandable.
(As you can see, not the same values as above)

Ty for your patience!

  • 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-11T14:43:33+00:00Added an answer on June 11, 2026 at 2:43 pm

    You may use this to convert from polar (radius, angle) coordinates to cartesian ones :

    // θ : angle in [0, 2π[
    function polarToCartesian(r, θ) {
        return {x: r*Math.cos(θ), y: r*Math.sin(θ)};
    }
    

    For example, if you want to draw at 12°, you may compute the point like this :

    var p = polarToCartesian(150, 12*2*Math.PI/360);
    p.x += 150; p.y += 150;
    

    EDIT : my polarToCartesian function takes radians as input, as many function in the Canvas API. If you’re more used to degrees, you may need this :

     function degreesToRadians(a) {
         return Math.PI*a/180;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HTML5 canvas provides lots of flexibility to draw images using javascript. We need to
Working on a small game using an HTML5 canvas, and javascript. And it's working
Im using JavaScript, the HTML5 canvas-element and WebGL to make a simple 3D-game in
i'm looking at creating a web game using html5 canvas and javascript. i was
I'm using the HTML5 canvas and JavaScript to make a basic game, and I
Is there a way using javascript html5 canvas, to have a polygon and then
I have made a game using HTML5 Canvas Element, Javascript for facebook. You can
I have made a snake game using javascript and HTML5 Canvas element. It can
I'm working on a HTML5 canvas game using a JavaScript library called Propulsionjs.com. The
I am drawing an image in HTML 5 using canvas in JavaScript. I need

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.