Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » Drawing ellipse with Painter with 2 foci
Drawing ellipse with Painter with 2 foci [message #52307] Tue, 03 September 2019 09:00
mirek is currently offline  mirek
Messages: 13440
Registered: November 2005
Ultimate Member
I had a situation where I needed this, having 2 foci Pointfs (a1, a2) and "radius at focus" (r) (minimum distance focus - ellipse).

So if need this and are too lazy to solve very simple math, here is the code:

		double d = Distance(a1, a2);
		iw.Begin();
		iw.Translate(0.5 * (a1 + a2));
		iw.Rotate(Bearing(a2 - a1));
		iw.Ellipse(0, 0, 0.5 * d + r, sqrt((d + r) * r)).Stroke(1, Black());
		iw.End();


Previous Topic: What is the minimum OpenGL version required for GLCtrl?
Next Topic: Key/Value store disk-based caching solution
Goto Forum:
  


Current Time: Mon Oct 18 10:38:44 CEST 2021

Total time taken to generate the page: 0.00820 seconds