assuming i have a square:
+ i know the coordinates of point A + point C, or the coordinates of point B + point D...
how can i find the coordinates of the other 2 points?
assuming i have a square:
+ i know the coordinates of point A + point C, or the coordinates of point B + point D...
how can i find the coordinates of the other 2 points?
![]()
![]()
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)
IF
A = X1, Y1
C = X2, Y2
THEN
B = X2, Y1
D = X1, Y2
-tg
* I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
*Proof positive that searching the forums does work: View Thread *
* How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
* How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
* Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
"There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN
i forgot to mention, the square will be rotated
![]()
![]()
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)
Given A and C (as PointF) then
I hope.... I did it "by eye".Code:Dim B, D As New PointF B.X = ((C.X + A.X) + (A.Y - C.Y)) / 2 B.Y = ((A.Y + C.Y) + (C.X - A.X)) / 2 D.X = ((C.X + A.X) - (A.Y - C.Y)) / 2 D.Y = ((A.Y + C.Y) - (C.X - A.X)) / 2Let me know.
Given A and C, the center of the square is M = (A+C)/2. Suppose P is a vector perpendicular to the vector from A to C of the same length. Then B is M + P/2 and D is M - P/2. In 2D, it happens that given a vector (x, y), the vector (-y, x) is perpendicular to (x, y). Since the vector from A to C is C-A = (C.x - A.x, C.y - A.y), P is just (A.y - C.y, C.x - A.x). In all...
B.x = (A.x + C.x)/2 + (A.y - C.y)/2
B.y = (A.y + C.y)/2 + (C.x - A.x)/2
D.x = (A.x + C.x)/2 - (A.y - C.y)/2
D.y = (A.y + C.y)/2 - (C.x - A.x)/2
These formulas agree with Inferrd's, so they should be what you were after.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
![]()
![]()
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)