question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to draw an angle in Cindyjs?

See original GitHub issue

I would like to draw a wedge that represents an angle:

image

In EaselJS I used shape.graphics.arc(x, y, radius, startAngle, endAngle);

How to do this with CindyJS? I do not get it to work with drawarc(‹point1›,‹point2›,‹point3›), see: https://jsfiddle.net/kai_noack/uLabvpqh/1/

What I need is to specify a start and end angle and it draws the arc with a given radius.

It would be great to have such a function in core, because I use it widely with geometry drawings.


PS: It would be great to have a library of all cindyjs examples where you can search through the entire source code. This way I would search for "drawarc" and see if there is something I can use. I searched the gallery by looking at the preview images only.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
montagacommented, Apr 3, 2019

you should compute

A = P+polar(degstart°);
B = P+polar(degend°);
1reaction
montagacommented, Jan 16, 2019

I think, you want to call

polar(alpha):=(cos(alpha),sin(alpha));
anglemark((0,0), polar(anglestart°), polar(angleend°), 4.5);

where anglestart and angleend are angles specified in degree and usee the original anglemark(P,A,B,r) function.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Elementary Drawing Functions
The operators described in this section are used to draw points, lines, ... steps with a list of 17 angles that correspond to...
Read more >
CindyJS example Gallery
Drawing many objects ... Angle Bisector Pappos Euler Line Prjective Grid ... The example gallery and the viewer is part of the CindyJS...
Read more >
Complex Functions with CindyJS - Live Coding
First, we want to draw something within an annulus. ... to calculate its angle to the origin and color the pixel according to...
Read more >
Hello, CindyJS! / Bryan Gin-ge Chen
The red points control the origins of the lines and the green points control the angles. Try dragging them around! simpleGeoCindy = TypeError: ......
Read more >
Forum - How to finesse CindyJS
Use "Export to CindyJS" from the File menu to create such a page. 1) You will notice that the dependent points are drawn...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found