circle

Collision Handling Between Circle and Line Segments

Hello, I'm implementing a small game and am having trouble getting the physics working properly. In this game, there is one ball (a circle which moves from frame to frame, and may change radius) and several walls (line segments which also change and move from frame to frame). I can detect collisions properly, and making the ball bounce ...

How can I draw a circle on an image in MATLAB?

I have an image in MATLAB: im = rgb2gray(imread('some_image.jpg'); % normalize the image to be between 0 and 1 im = im/max(max(im)); And I've done some processing that resulted in a number of points that I want to highlight: points = some_processing(im); Where points is a matrix the same size as im with ones in the interesting poin...

Why does a circle plotted in MATLAB appear as an ellipse?

I wonder in MATLAB how I would plot a circle and show it correctly instead of by default showing it as an ellipse. I guess it has something to do with the local coordinate system in the axis. ...

How to make a circular UIView

I want to make a UIView or UIImageView that is a circle. Or a circle that i can change the size of using a slider, and the color of with a pickerview. ...

Dragging A Circle on a JFrame

I am trying to have a circle appear on the screen, then when the user clicks INSIDE the circle, enable the ability for them to drag the circle where the mouse goes while it is being pressed. This is the code i have so far, the drag works, but it is allowing the user to drag without them pressing the inside of the circle, just when anywh...

Android 2D opengl line circle

I am new to open gl, and have been trying to do some basic 2d openGL in android. I am able to set up my 2D view, and draw squares and triangles. I am trying to draw a circle and am not exactly sure how to do it. I have found several techniques while searching, one using triangles rotated around the center w/ the given radius, this wil...

How to draw a circle in Flex MXML file?

In my MXML file, I have a tab navigator with three vboxes. <mx:TabNavigator width="624" height="100%"> <mx:VBox label="Currents Quote" width="100%"> </mx:VBox> <mx:VBox label="Quote Comparison" width="100%"> </mx:VBox> <mx:VBox label="Reports" ...

Finding the coordinates on the edge of a circle

Using C#: How do I get the (x, y) coordinates on the edge of a circle for any given degree, if I have the center coordinates and the radius? There is probably SIN, TAN, COSIN and other grade ten math involved... :) ...

Converting a class from Mootools to jQuery or classic javascript

Following Mootools class helps developer to draw a circle overlay on Google Map using Google Maps API v3. I'm using jQuery in my projects and entry-level knowledge in Object-oriented javascript. In Google Maps API v2, this is very easy but API v3 currently haven't built-in methods for drawing circles on map. Plus, in API documentation, ...

How to draw an arc from radius and inner angle in Silverlight

Hi, In a silverlight 3 project I have to draw an arc programatically and I have radius of circle and inner angle of the arc. Could you please direct me to some related articles. Thanks in anticipation! Haris ...

Circular JPanel Swing

Hi, I am trying to display a circular object in my gui, the circular object should contain a few labels therefore I thought the circle object should extend JPanel. Does anyone know how to make a circular JPanel? Or at least a JPanel which paints an oval and places a few JLables in the centre of the oval? Thanks ...

how to move circle with mouse in delphi?

how to move circle with mouse in delphi? circle:Shape; ...

After drawing circles on C# form how can i know on what circle i clicked?

I have to represent graphically an oriented graph like in the image below. i have a C# form, when i click with the mouse on it i have to draw a node. If i click somewhere on the form where is not already a node drawn it means i cliked with the intetion of drawing a node, if it is a node there i must select it and memorize it. On the n...

tangent of two circles

Hello, I am trying to write some code that that will draw the line which is a tangent between 2 circles. so far i have been able to draw multiple circles, and lines between the centers. i have a class which stores the values used in drawing the circles (radius, position). what i need is a method in this class to find all posible tangents...

How to draw a circle in java with a radius and points around the edge

Hi, I'm really stuck on how to go about programming this. I need to draw a circle within a JFrame with a radius and points around the circumference. i can mathematically calculate how to find the coordinates of the point around the edge but i cant seem to be able to program the circle. I am currently using a Ellipse2D method but that doe...

Collision detection of huge number of circles

What is the best way to check collision of huge number of circles? It's very easy to detect collision between two circles, but if we check every combination then it is O(n2) which definitely not an optimal solution. We can assume that circle object has following properties: Coordinates Radius Velocity Direction Velocity is c...

circles and triangles problem

Hello everyone, I have an interesting problem here I've been trying to solve for the last little while: I have 3 circles on a 2D xy plane, each with the same known radius. I know the coordinates of each of the three centers (they are arbitrary and can be anywhere). What is the largest triangle that can be drawn such that each vertic...

Multiple circles -> One Polygon?

Using Google Maps API v3, I was able to create multiple google.maps.Circle objects on my map. However, I now need to "connect" them somehow. I have the following map with multiple circles: I now need to get it to look something like this: I've looked all over the Internet for solutions, but to no avail. Any ideas? ...

Drawing Quadratic Bezier circles with a given radius: how to determine control points

Just to clarify; the code below works, but I don't understand where the formula for the variable "controlRadius" comes from. I wrote this function by dissecting an example I found elsewhere, but I can't find any explanation and the original code comments were not able to be translated. Thanks in advance //returns an array of quadrati...

Draw a semicircle / half circle in WPF / C#

Hello, I need to draw a semicircle / half circle in WPF. Any idea how to do that? Thanks for any hint! ...