circle

Project Euler Problem 233

I've decided to tackle Project Euler problem 233 next but I'm having some major problems! I've done some analysis and have made some quite nice progress but I've become stuck now. Here's my working: Lemma 1: Since the circle goes through the 4 corner points there are at least 4 solutions for any n. But for each point on the circumferenc...

Calculating point on a circle's circumference from angle in C#?

I imagine that this is a simple question, but I'm getting some strange results with my current code and I don't have the math background to fully understand why. My goal is simple, as stated in the title: I just want to find the point at some distance and angle from a center point. My current code: Point centerPoint = new Point ( 0, 0...

Fast circle collision detection

I'm trying to write a method that will calculate if two circles are overlapping. I've come up with the following and I'm just curious to know if there is anyway it could be optimised further. private static boolean isCollision(Point2D p1, float r1, Point2D p2, float r2) { float a,dx, dy; a = (r1+r2) * (r1+r2); dx = (float) (p1.getX()...

How do I generate circuar thumbnails with PIL?

How do I generate circular image thumbnails using PIL? The space outside the circle should be transparent. Snippets would be highly appreciated, thank you in advance. ...

Batch file: Password Stars/Circles

Like you already know, websites have certain special chars for passwords, like stars and circles. Could this be possible in a batch file, on the following one:? If this is not possible, if you type it in, could you just see nothing? set pass= set /p pass=Enter your password: if {%pass%}=={} goto :begin set authenticated= for /f "toke...

Changing the speed of a circular motion

I'm looking for a way to smoothly increase or decrease the speed of a circular movement. Using the parametric equation of a circle, I can move an object in a circle over time: x = center_x + radius * sin(time * speed) y = center_y + radius * cos(time * speed) The problem with this approach is that I can't simply do speed = speed + 1 ...

UIButton: Need a circle hit area

Ok I have 6 custom UIButtons. Their normal state image are all circles images. They are all spaced out equally but all the circles touch each other. The problem with the custom UIbutton (which has a circle image on it), is that the hit area of that button is square, and the corners of this square overlaps the hitarea of the other custom...

How to make a circle on a grid?

I'm making a game where all movement is grid based. I also wan't to make entities that can travel around in a circle. So does anyone have any suggestions for creating a circle out of a grid of squares (like the way MS Paint uses the circle tool to make a circle out of square pixels). ...

PHP/GD, how to copy a circle from one image to another?

Is there a reasonably straightforward way to copy a circular area from one image resource to another? Something like imagecopymerge except with circles or ovals etc? If possible, I want to avoid having to use pre-created image files (any oval shape should be possible), and if there's transparency colours involved they should naturally le...

Circle line collision detection

I have a line from A to B and a circle positioned at C with the radius R. This is in two dimensions. Which is a good algorithm to use to check whether the line intersects the circle? And at what coordinate along the circles edge it occurred? ...

How to draw a solid circle with cocos2d for iPhone

Is it possible to draw a filled circle with cocos2d ? An outlined circle can be done using the drawCircle() function, but is there a way to fill it in a certain color? Perhaps by using pure OpenGL? ...

How to draw a decent looking Circle in Java.

I have tried using the method drawOval with equal height and width but as the diameter increases the circle becomes worse looking. What can I do to have a decent looking circle no matter the size. How would I implement anti-aliasing in java or some other method. ...

[graphviz/dot] size of node with shape=circle

hi guys, i'm trying to set the size of the nodes this way: controller[shape=circle,width=.5,label="Controller",style=filled,fillcolor="#8EC13A"]; But all three nodes are with different size. How can i set fixed size? ...

Drawing irregular concentric circles using Google Maps

I have a bit of a problem. I am trying to do the following using Javascript & the Google Maps API v2: I can draw individual circles just fine using formulas found all over the Internet. The problem I am facing is that the circles must: A. Be concentric, and B. Must have different radius for each "quadrant", i.e., NE, NW, SE & SW I'...

How to find the minimum radius circle that encloses all the given points?

Suppose I have some 1000 odd points on a plane. Then, what I think could be done is to discard the points that do not affect the radius of the circle in any way - the points through which the convex hull does not pass [using one of the several algorithms]. This leaves us with points that do matter. Now from here on, what can be done to...

Find if an angle is within X degrees from another

I need an algorithm to figure out if one angle is within a certain amount of degrees from another angle. My first thought was (a-x < b) && (a+x > b), but it fails when it has to work with angles that wrap around from -179 to 180. In the diagram above, the region (green) that the angle must be between wraps between the negative and po...

find points that are within a circle given center and radius

We have a point (x,y) and some other points (xi,yi). How can we determine wich of (xi,yi) points are within a circle with center (x,y) and radius d (a given number) Thanks ...

how to differentiate between circle rectangle and triangle ?

sorry but i need help how to differentiate between circle rectangle and triangle in black and white images-bitmaps- ...

How to create circle with Bézier curves?

we have some x, y start point and some circle radius. We have some engen that can create path from bezier curve points. How to create circle with Bézier curves? ...

How do I draw a mysql polygon circle, and not a square?

The function below creates a polygon square out of 4 points and I assume the last 5th point closed the squar, I need it to have at least 24 points and to make up a circle. Any ideas? function getRadius($point="POINT(-29.8368 30.9096)", $radius=2) { $km = 0.009; $center = "GeomFromText('$point')"; $radius = $radius*$km; ...