how can i draw this (attached image)?
i'm sure there must be a mathematical formula for the radii.
i tried to draw the arc but that isn't simple either, so any help would be appreciated...![]()
how can i draw this (attached image)?
i'm sure there must be a mathematical formula for the radii.
i tried to draw the arc but that isn't simple either, so any help would be appreciated...![]()
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
The lines are given by endpoints of the form (0, nw), ((m-n)w, 0) for constant m and w, and for n ranging from 1 to to m-1. In the drawn case, m=16, one more than the number of lines drawn, and I'd estimate w (the width) at around 20 pixels. The curve is a little harder to figure out. Suppose instead of discrete lines we had a continuum of lines, with endpoints (0, d), (D-d, 0) for some constant D, d ranging from 0 to D. The equation of a line of that form is...
y(d) = d - xd/(D-d)
Imagine focusing on lines slightly to the side of y(d), say y(d+e) for e small. Intersecting these two algebraically one finds the point of intersection is ((D-d)(D-(d+e))/D, d(d+e)/D). In the limit as e goes to 0 the intersection point is ((D-d)^2 / D, d^2 / D). One can show these x and y values are on the curve
y = (D - sqrt(Dx))^2 / D, x between 0 and D
The limiting curve, as you take arbitrarily many points, is then like this (unfortunately the x and y axes have different spacing there, so it's a little distorted).
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
i self resolved it, but i was guessing you'd reply.
your mathematics is light years ahead of mine, but this is my solution:
vb.net Code:
e.Graphics.DrawArc(Pens.Black, 0, -Me.ClientSize.Height, CInt(Me.ClientSize.Width * 2), CInt(Me.ClientSize.Height * 2), 90, 90) Dim degrees() As Integer = Enumerable.Range(1, 60).Select(Function(x) x * 6).ToArray Dim radians() As Single = Array.ConvertAll(degrees, Function(x) CSng(Math.PI * x / 180)) Dim points1() As PointF = Array.ConvertAll(radians, Function(f) New PointF(CSng(Me.ClientSize.Width + Math.Sin(f) * Me.ClientSize.Width), CSng(0 - Math.Cos(f) * Me.ClientSize.Height))) Dim points2() As PointF = Array.ConvertAll(radians, Function(f) New PointF(CSng(Me.ClientSize.Width + Math.Sin(f) * (Me.ClientSize.Width + 200)), CSng(0 - Math.Cos(f) * (Me.ClientSize.Height + 200)))) For x As Integer = 31 To 44 e.Graphics.DrawLine(Pens.Black, points1(x), points2(x - 10)) Next For x As Integer = 44 To 29 Step -1 e.Graphics.DrawLine(Pens.Black, points1(x), points2(x + 10)) Next
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
I'm glad it worked out. I confess I haven't fully worked through the logic behind your code. I was somewhat shocked it worked when I tried it; I can see the logic in general, but it gets closer than I'd expect to the original pattern considering how indirect the method is. In any case, I had something like the following in mind:
vb.net Code:
Dim m As Integer = 16 Dim w As Integer = Me.ClientSize.Width / (m - 1) Dim points1() As PointF = Enumerable.Range(1, m - 1).Select(Function(n) New PointF(0, Me.ClientSize.Height - w * n)).ToArray Dim points2() As PointF = Enumerable.Range(1, m - 1).Select(Function(n) New PointF(w * (m - n), Me.ClientSize.Height)).ToArray For n As Integer = 0 To m - 2 e.Graphics.DrawLine(Pens.Black, points1(n), points2(n)) Next
It produces extremely similar output to both your method and your original picture.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
thanks again jemidiah...
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)