FAQ Database Discussion Community


C# wpf Ellipse width and height for two points

c#,wpf,wpf-controls,ellipse
I'm trying to draw a circle centered at point2 with radius "r". r's length should be long enough to be the distance between point1 and point2. I drew a picture to illustrate this. How can I calculate the correct width and height of the ellipse to draw it like this...

Matlab: contourf or colormap to plot filled ellipses according to radius

matlab,plot,ellipse,colormap,contourf
I am trying to use either the contourf or colormap functions to plot filled ellipses with colors according to their arcsin(b/a) value (a=major axis, b=minor axis). clearvars -except data colheaders close all clc data(:,9)=data(:,9)*pi/180; % Convers Column 9 (angle of rotation) in rad data(:,6)=1196-data(:,6); % Reset the Y coordinate axis...

How to fit an elliptic cone to a set of data?

matlab,regression,curve-fitting,ellipse,best-fit-curve
I have a set of 3d data (300 points) that create a surface which looks like two cones or ellipsoids connected to each other. I want a way to find the equation of a best fit ellipsoid or cone to this dataset. The regression method is not important, the easier...

iOS swift - how to draw an ellipse with touch event

ios,swift,drawing,ellipse
currently I am trying to port my old windows phone app to iphone. The UI looks like this: I want to know how to do the following: Draw a solid ellipse on a specific position, e.g. at position x = 0, y = 0; The ellipse change its color upon...

data fitting an ellipse in 3D space

matlab,mathematical-optimization,ellipse,data-fitting
Forum I've got a set of data that apparently forms an ellipse in 3D space (not an ellipsoid, but a curve in 3D). Being inspired by following thread http://au.mathworks.com/matlabcentral/newsreader/view_thread/65773 and with the help from someone ,I manage to get the optimization code running and outputs a set of best parameters...

FillEllipse Error

c#,exception,graphics,drawing,ellipse
I get a JIT compiling error running this code void draw(PaintEventArgs e) { Graphics gr =this.CreateGraphics(); Pen pen = new Pen(Color.Black, 5); int x = 50; int y = 50; int width = 100; int height = 100; gr.DrawEllipse(pen, x, y, width, height); gr.Dispose(); SolidBrush brush = new SolidBrush(Color.White); gr.FillEllipse(brush,...

Draw Rotated Ellipses on Matlab

matlab,ellipse,drawellipse
I am trying to plot a series of ellipses on Matlab. Basically I have a microscopic picture and I process it with ImageJ to obtain a series of data (area, center, major and minor axes) for each ellipse. I am trying to replot those ellipses on matlab in order to...

Fitting an ellipse through orbital data

python,scipy,ellipse,astronomy,minimization
I've generated a bunch of data for the (x,y,z) coordinates of a planet as it orbits around the Sun. Now I want to fit an ellipse through this data. What I tried to do: I created a dummy ellipse based on five parameters: The semi-major axis & eccentricity that defines...

How can I check if an object is a Rectangle or an Ellipse

c#,wpf,rectangles,ellipse
How can I check if the object that is created a Rectangle or an Ellipse is in WPF? Ellipse ellipse = new Ellipse(); Rectangle rect = new Rectangle(); if (rect.getType()){ rect.Margin = new Thickness(x,y,0,0); } else { ellipse.Margin = new Thickness(x, y, 0, 0); } ...

Grouping objects in JavaFX?

java,user-interface,javafx,scenebuilder,ellipse
So I'm currently making a JavaFX GUI (with SceneBuilder) for a Connect4 game, and I was wondering if there's a way to 'group' objects together so that I can perform an action on all of them together? Examples of what I mean: I have 7 buttons for the columns (colButton1-7)...

Ambiguity in Ellipse Detection in opencv c++

c++,opencv,ellipse
Hey i am doing the road sign detection project from last two weeks and i am getting the major problem for detecting the ellipse from the image.Can anyone tell me how can i handle this problem!!!You can see the result and code.Thanks vector<vector<Point> > contours; vector<Vec4i> hierarchy; findContours(GreyImage, contours, hierarchy,...

sqrt-based filled ellipse pixel drawing function

vb.net,lua,draw,pixels,ellipse
I'm trying to make a function in Lua or VB based code to draw / plot a filled ellipse. I don't have much knowledge about this math and I can use some help. I Googled everything there is to Google about drawing ellipses with code but I can't find a...

Draw an ellipse sqrt-based function

vb.net,plot,lua,draw,ellipse
I'm trying to make a function in Lua or VB based code to draw / plot an ellipse and also a filled ellipse. I don't have much knowledge about this math and I can use some help. I googled everything there is to google about drawing ellipses with code but...

Matlabs ellipse hours calc

matlab,geolocation,geocoding,ellipse,hour
I make sundial simulator and i draw ellipse and then i have to draw hours on this ellipse. Every our is specified by: x = a * sin(t); y = b * cos(t); where: a- length of longer semi-axis b- length of smaller semi-axis t- hour in degrees ( 1...

Cycle through oval/elliptical object with CSS or JavaScript

javascript,css,css3,animation,ellipse
There's a small challenge that has taken my sleep for a few days. I didn't get success in all my attempts. To be honest, I didn't even get close. So, basically I need to animate the object (sun) so that it travels continuously along the path of the oval. When...

How to create custom stroke color of ellipse?

c#,wpf,colors,ellipse,stroke
I was looking around for some answers but couldn't find anything. I want to know if there's a way to make a custom stroke for an ellipse. I have a bunch of ellipses drawn on a canvas that, when clicked, the clicked ellipse is highlighted with a green stroke. I...

Making an ArrayList containing objects (Ellipses, Rectangles etc.)

java,arraylist,javafx,circle,ellipse
I am creating a program for a school project where the user can create a geometrical shape (which is supposed to look like a horse) using buttons which control the size and color of: One Ellipse, one Circle, two Rectangles and one String (as a title for the figure). To...