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
1
vote
1 answer

Get points of svg/xaml arc

Format of svg arc (arc in xaml have same args): (rx ry x-axis-rotation large-arc-flag sweep-flag x y) Description: Draws an elliptical arc from the current point to (x, y). The size and orientation of the ellipse are defined by two radii (rx, ry)…
AndreyAkinshin
  • 18,603
  • 29
  • 96
  • 155
1
vote
1 answer

Arc Consistency in Java, questions on implementation

So my goal is to write the method that solves a sudoku puzzle, we were given the method stub "public int[][] solve(int[][] board)". We are supposed to use arc consistency and domain splitting to find the solution. -The way I started doing it was by…
methodMan
  • 629
  • 2
  • 11
  • 27
1
vote
3 answers

Is it possible to change the shape of android seek bar?

I want to implement something similar to android seek bar.But not in a linear fashion,in an arc shape. is it possible to customize the seek bar in an arc shape?
Ads
  • 6,681
  • 12
  • 47
  • 72
1
vote
1 answer

Calculate size of a circle from arcs?

How can I calculate the size of a circle from a set of arcs? Specifically, I have this SVG path definition which draws a circle, I'm looking to work out its size.
Ollie Glass
  • 19,455
  • 21
  • 76
  • 107
1
vote
1 answer

Check if triangle is equilateral in Prolog

I'm learning Prolog and trying to create a program to check if a triangle is equilateral. Here is my code equilateral(point2d(X1,Y1),point2d(X2,Y2),point2d(X3,Y3)):- ((X2-X1)*(X2-X1) + (Y2-Y1)*(Y2-Y1)) =:= ((X3-X2)*(X3-X2) + (Y3-Y2)*(Y3-Y2)), …
1
vote
2 answers

Drawing a Projectile Motion Path in Android

I asked this question before, but I think I worded it badly and thus did not get any response. I am trying to make an app for android that draws the path of an object in projectile motion. I have the equations to make this work, but for some reason,…
Tom C
  • 232
  • 1
  • 6
  • 17
1
vote
3 answers

How to draw an arrow between two images in WinForms?

I have to do this: to draw an arrow between two images from my canvas, so when I click the button with the arrow on it and I put click on one image to paste the arrow on it and then to draw the arrow as long as i need and to paste it to the second…
Lidia
  • 33
  • 1
  • 5
1
vote
0 answers

SceneKit Orbital Transformations

So having started with SceneKit all has gone well so far until I stumbled upon transformations, thinking that it would be like CA3d* transformations on layers. However it seems I quite wrong and transformation work quite differently with regards to…
iQ.
  • 3,811
  • 6
  • 38
  • 57
1
vote
1 answer

How to draw a tapered arc (curve with decreasing thickness) in OpenGL?

I have the following code to draw an arbitrary arc: void CenteredArc::drawPolygonArc(float radius, float thickness, float startAngle, float arcAngle) { float num_segments = 360.0; float radiusOuter = radius + thickness / 2; float…
carmenism
  • 1,087
  • 3
  • 12
  • 31
1
vote
1 answer

Find all pixels a given radius from a point, confined within an arc

I'm working on an autonomous rover that navigates partially by ultrasound proximity sensors. Before we implement the hardware we want to do some testing of our algorithms with a simulator, which I am now writing. One task that I'm having some…
Huckle
  • 1,810
  • 3
  • 26
  • 40
1
vote
1 answer

Drawing angled rectangles/arcs on android canvas

I am trying to modify a joystick component for the android device. Currently the component is able to track the x and y position of your finger and draw a small circle there. Now what I want to do is draw a rectangle or arc from the center to the x…
Andrew Poland
  • 185
  • 4
  • 14
0
votes
1 answer

Drawing an arc in java script but it doesn't appear

I'm working on a simple html/js project to get a box moving in a canvas that can shoot a ball. I got the box moving but I cant get the ball to appear. The program makes it to the drawBall() and moveBall()(Tested using alerts) functions but they…
DuxClarus
  • 159
  • 1
  • 3
  • 12
0
votes
1 answer

How do you select Arcs inside a boundary in PostGIS?

I'm searching an answer for this question and all I found on http://postgis.refractions.net/documentation/manual-1.3/ch04.html#id2572194 is SELECT road_id, road_name FROM roads WHERE roads_geom && GeomFromText('POLYGON((...))',-1); should I put…
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
0
votes
1 answer

Web design arc circle effect

Is there a way to emulate in HTML5/CSS (or JS) the arcs/circle like can be seen around the outside of this pic (the part where it says foundation, education, materials, etc)?
0
votes
1 answer

SVG path arc radius ratio

All the docs I've seen for the ArcTo instruction for a SVG 's d attribute give the first two arguments as the x and y radius of the arc. Earlier, though, I was playing around, and in FF8 and Safari 5, it seemed like the path
rampion
  • 87,131
  • 49
  • 199
  • 315