It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I would like C# code for determining the centre and radius of the circle that best fits the points in an array using the least squares method or equivalent.
Having searched on web I've found none.
You can either use a general minimization algorithm such as Levenberg-Marquardt or turn it into a linear problem and just solve for the parameters of the circle (x,y, radius). See this link for more information.
I'm not aware of any multivaraible Levenberg-Marquardt for .NET so the second solution is probably easier to go for. Note that you will need to solve a matrix equation of the form Ax=b to find your circle parameters. The Math.NET library seems able to do this.
You can try the FitEllipse function of the opencv library :
Fit ellipse
I think a C# wrapper of OpenCV exists.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am using Google MAP Integration using C#. Now I wish to create Screen Line function. In short I just want to draw between two points on a click event on Google Map.
Let me know if you need to detail on the problem.
Here's how to do it using the Javascript API v3:
https://developers.google.com/maps/documentation/javascript/overlays#Polylines
But it sounds like you may be using some sort of control that does it for you in C#. I'm going to guess because you haven't provided more information about what you are using to create the map, but let's assume you're using:
http://googlemap.codeplex.com/
(Which is a great Google Maps control for WebForms). This Control has a polyline extender which does what you need to, located here:
http://googlemap.codeplex.com/wikipage?title=GoogleMap%20Control%206.0&referringTitle=Documentation
Which is downloadable here:
http://googlemap.codeplex.com/wikipage?title=GooglePolyline6
There is information on the PolyLine class in their documentation here:
http://googlemap.artembg.com/docs/
If this doesn't answer your question, please provide more information about the Google Maps implementation you are using.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am quite amazed at what you can now do in an html5 canvas/svg driven by javascript, and I would like to know if there is any drawing library for .NET that would have similar performance and simplicity of use. I am thinking that if there were, then I could build some kind of tool that would be like d3.js for .net.
I am looking for a library that would allow me to draw svg-like elements in real time.
Any idea?
Using WPF and the canvas control you can do SVG like "drawing" very easy and like the HTML5 canvas is ofter hardware accelerated.
Other options would be using the DirectX api, either wrapped or native, XNA for pure game development or the GDI(+) library.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
i cant convert d->max to C# i use openssl and the problem of convert c++ to C# the bignum of Rsa->d i cant found it in Openssl Reference in C# rsa.d not found
rsa->n
rsa->e
If we limit ourselves purely to the code in the question, then -> is the pointer-to-member operator. In C# for both values and references that is ., so the equivalent code is just rsa.n, rsa.e and d.max. Unless it is an unsafe pointer to a struct, in which case rsa->n, rsa->e and d->max (so: the exact same code, but this is very unlikely in most C#).
However, I do not expect that will help you - I think you need to step back a few steps and look at what you are trying to do, rather than blindly trying to convert a sample you don't understand. It may well be that the actual solution here is to use a different library.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I asked a question about moving images with timer in c# . Some people said to me to use WPF. But I never worked with WPF before. I looked msdn but don't understand it.
Please help me, I really need this soon.
I would suggest you to have a look at Expression Blend video tutorial. Learning and implementing wpf without out tools like Expression Blend is quite challenging. http://expression.microsoft.com/en-us/cc197141.aspx
In short, in WinForms (I assume you use WinWorms when you don't use WPF) to animate some elements on the screen, so the following:
Override the forms OnPaint method, and inside there, draw the image(s) on the desired positions.
Make a backgroundworker tat support sending progress.
In the backgroundworker calculate the new positions, then call ReportProgress.
In the report progress event method, redraw the images on their new positions.
Remember to set the forms DoubleBuffered property to true so that the redrawing is done smoothly.
Good luck! :)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm trying to develop a program to recognize a hand gestures and base on the hand gestures, run some commands or move the mouse. how can I use AForge.NET with C#??? it is possible to do that? is there any tutorial out there???? Please help
Here is an article by the author of AForge.NET, although it is not about gesture detection
A gesture sample on codeproject (not using AForge.NET) or another sample (this time using AForge.NET) showing how to uset the library. Hope it helps.