Questions tagged [geometric-arc]

A geometric shape that represents a segment of a circle. Generally is measured by two angles, starting and ending, and it's radius. If you need an arc of an ellipse, please be sure to tag the question with the [ellipse] tag as well.

Geometric Definition:

An arc is a geometric shape used for drawing circle segments. It is comprised of three main parts:

  • staring θ: the angle measure, for the first part of the sub-circle, usually in radians
  • ending θ: the angle measure, for the ending part of the sub-circle, usually in radians
  • radius:     the radius of the circle that this arc is a part of.

Arcs in computer programming cannot be accurately represented, as the value of π is infinite. Thus, any circle or arc you see will always be slightly inaccurate, although most algorithms usually keep that with a few pixels.

The length of an arc can be approximated by the following formula:

       Arc Length Forumla

Notice that on some systems, the length of an arc can be negative, specifying that it moves counter-clockwise around the circle, instead of clockwise. This is usually represented by a flag being set from the calling function.

On Specific Systems:

For windows, arcs can be drawn using the functions, and can also draw arcs of ellipses.

Example in :

void drawArc(Graphics myGraphics, Pen myPen, float x, float y, float startTheta, float endTheta, float radius)
{
    myGraphics.DrawArc(myPen, x - radius, y - radius, radius * 2, radius * 2, startTheta, endTheta);
}

Arcs can also be drawing using the equivalent drawing functions.


For Mac OS X, arcs can be drawn using the NSBezierPath class in AppKit.

Example in :

void drawArc(float x, float y, float startTheta, float endTheta, float radius)
{
    NSBezierPath *bezierPath = [NSBezierPath bezierPath];
    [bezierPath appendBezierPathWithArcWithCenter:CGPointMake(x, y) radius:radius startAngle:startTheta endAngle:endTheta];
    [bezierPath stroke]; // draws with current set color
}

In Java, you can draw arcs as well, using the portable functions found in the Graphics class.

77 questions
0
votes
1 answer

Scale command applying to multiple shapes

Wondering why the scale parameter of the variable ´ell´ is applying to the next two circles I have created as well: var ell=canvas.getContext("2d") ell.beginPath() ell.lineWidth=2 ell.fillStyle="#FFFFFF" …
Bryce
  • 356
  • 1
  • 16
0
votes
1 answer

hi all . i am trying to run the bym2 model . at this stage, i have a problem.are you help me?

library(“rstan”) library(“rstudioapi”) library(“parallel”) library(“brms”) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectgores()) library(pkgbuild) # load packAge find_rtools() # should be TRUE, assuming you have Rtools…
shal
  • 1
  • 1
0
votes
1 answer

Why do we need to convert Rotational vector to Rotational matrix to calculate angle

I am not getting any proper source to understand why we need to change rotational vector to rotational matrix [in the context of calculating angle between two ARUco markers]. We are using rmat = cv2.Rodrigues(rvec) rmat1…
0
votes
1 answer

Can somebody please help me with a geometric transformation problem?

I need to draw a circular arc between two given points. I also have the arc's radius. I understand that this can be done using standard canvas APIs but I need to handle the case of elliptical arcs too. This code is a generalized solution. The only…
AppleGrew
  • 9,302
  • 24
  • 80
  • 124
0
votes
0 answers

Geometric shapes

I am working on my project with assembly language I have a text file each line in the text contain 2 coordinates (x1,y1) (x2,y2) and this coordinates is a line i can draw , my task is to find the how many rectangles and how many squares and…
Marox587
  • 35
  • 6
0
votes
1 answer

Arc2D.Double contains(double x, double y) method not working

Background: A little background info, this is taking place on JPanel (PiePanel) thats inside a JPanel on a JFrame. On PiePanel, i have added a Component that draws objects from class Pie that extends Arc2D.Double and creates Arcs in PIE form.…
David
  • 27
  • 6
0
votes
1 answer

Displaying ImageView edges as arcs

I want to display the the images by using the ImageView with edges as arc Please help me.
surendra
  • 2,217
  • 7
  • 34
  • 42
0
votes
2 answers

HTML5 canvas: Mutliple arc shapes with for loop

Hi there my problem with the code below is the the arc is creating 1 shape not the ten specified in the for loop... If I was to change from arc to $cd.fillRect(10,20,$x,$y); then that would create 10 different rectangles but not the arc... what am I…
AndyW
  • 272
  • 1
  • 2
  • 13
0
votes
2 answers

R combine two lists of sfc_polygons

Hej, I have two lists of polygons. The first one is a list of 1 polygon (circle) The second is a list of 260 polygons (260 rectangles). See the first picture (two lists of polygons). Now I want to keep all the rectangles that are touched by the…
Pit Strehl
  • 21
  • 1
0
votes
1 answer

Drawing a Thick, Arched Line in Android

Greetings Everyone. I was wondering how would I go about drawing an ached line on a canvas. If I were to continue this line it would make a perfect circle. I've got pie wedges which is close but I just want the outside of the wedge and it needs to…
Mitchell
  • 929
  • 2
  • 11
  • 34
0
votes
1 answer

Creating an arced image with imagemagick

I am trying to use imagemagick to arc an image and have it fit into a predefined arc space. For that predefined arc I know the circumference of the top and bottom segments along with the width of the space between the two circumferences. I need to…
doclove
  • 153
  • 1
  • 14
0
votes
0 answers

Draw hourglass in random coordinates

Hey I need to draw an hourglass in different locations each time I start my app. I tried this way: Random randomNum = new Random(System.currentTimeMillis()); int a1=randomNum.nextInt(500); int a2=a1*2; int a3=a1; int a4=a2; int b1=a1; int…
user3235376
  • 87
  • 1
  • 2
  • 10
0
votes
2 answers

How to draw circular arcs in VB.NET

I have to generate the following figure according to user fed values. How do I go about drawing the arcs (B-C-F as in figure, circular in nature) given their start point & end point (B & F respectively) & the height from the segment BF? I can do…
shad0w_wa1k3r
  • 12,955
  • 8
  • 67
  • 90
0
votes
1 answer

Dividing a shape into congruent subregions

Given an irregular many face polygon with equal sides. Is there any algorithm to divide it into six equal sized congruent regions ??
Mahesh Gupta
  • 925
  • 2
  • 10
  • 25
0
votes
2 answers

Graphical web library which allows to click "arcs" on diagrams

I need a JavaScript library, or Flash as well, which allows to connect events to "click" over "arcs" in graphics. I've implemented my graphic through the JS-Graphs library, but I can only intercept the "click" event on "nodes", not on "arcs".
JuanDeLosMuertos
  • 4,532
  • 15
  • 55
  • 87