_Vlad Posted August 27, 2021 Share Posted August 27, 2021 Hello, I have a list of coordinates that must be placed correctly on a map. I've been trying to solve this problem for almost a week and I can't figure it out.' I tried to solve this using several UDFs or various solutions but none helped me out to come up with something. Any tips for a possible solution to this problem and dispaly the coordinates on the right place? Thank you very much for your attention. Link to comment Share on other sites More sharing options...
_Vlad Posted August 27, 2021 Author Share Posted August 27, 2021 I don't really need a code to work just an idea of how I could do the code by myself. Thank you! Link to comment Share on other sites More sharing options...
Nine Posted August 27, 2021 Share Posted August 27, 2021 Not very clear what you want to achieve from those coordinates. Can you show a few examples ? And explain further what you expect ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
_Vlad Posted August 27, 2021 Author Share Posted August 27, 2021 For example I have coordinate 109.3. I want to have a point which should be displayed in the right place according to the direction of the coordinate (ex : 109.3 will be somewhere between East (E) 90* and South (S) 180*. Link to comment Share on other sites More sharing options...
Nine Posted August 27, 2021 Share Posted August 27, 2021 Yes I understood that. But what would be the distance to put the point from the center ? Random ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
_Vlad Posted August 27, 2021 Author Share Posted August 27, 2021 It is ok if it is on the biggest line, non dotted. Link to comment Share on other sites More sharing options...
Nine Posted August 27, 2021 Share Posted August 27, 2021 Is the circle fixed dimension ? Do you you know the radius of the circle (in pixels) before ? Who is drawing the circle, you ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
_Vlad Posted August 27, 2021 Author Share Posted August 27, 2021 I know that the width of the circle is 450 and heigh 300 pixels. Link to comment Share on other sites More sharing options...
Nine Posted August 27, 2021 Share Posted August 27, 2021 That does not help much. Again, who is drawing the circle ? Do you have the code ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
_Vlad Posted August 27, 2021 Author Share Posted August 27, 2021 Unfortunately not. I just got the image from somewhere. I'll try my best to see what I can do. I also found out the Excel UDF which can create a radial chart but I don't figure out how. I m still trying now using this. It is ok if it's generated in Excel too. Link to comment Share on other sites More sharing options...
_Vlad Posted August 27, 2021 Author Share Posted August 27, 2021 It doesn't really matter if it's displayed on this chart or other or through other methods. Just a radial in which I can put this value and be displayed on a circle. The thing is that I have a lot of maritime data i work with and i want to do a script to show me the dominant current and it's intensity from a range of time. (Each hour represents a value) Link to comment Share on other sites More sharing options...
Nine Posted August 27, 2021 Share Posted August 27, 2021 (edited) Alright, my first intuition would be to use GDI+ to draw the circle and the points. You would control everything (radius, center of the circle, circumference, etc...). You can easily draw points also with it (see _GDIPlus_GraphicsDrawEllipse for both circle and points). To know the number of pixels between each degree, you just divide the circumference by 360. Once you have that you can calculate the x,y coordinates of a point based on its degree and the radius of the circle. My geometry is very very far, so I cannot give you right now the method of calculating it. Another solution would be to create a 2D array of coordinates for each of the 360 degree. Then you can extrapolate the position for in between degrees. Edit : Found it, was not so complicated after all : Const $radius = 100 For $angle = 0 to 360 step 45 $radian = _Radian($angle) $x = Round($radius * cos($radian), 2) $y = Round($radius * sin($radian), 2) ConsoleWrite("x = " & $x & " / y = " & $y & @CRLF) Next That is calculating X,Y position from the center of the circle. You will need to convert those coordinates to fit the 0,0 (upper left) client window position. Also the 0 degree is right most position of the circle going counter-clockwise while yours is the top most going clockwise (conversion required here also). Good luck. Edited August 27, 2021 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nine Posted August 27, 2021 Share Posted August 27, 2021 (edited) 7 hours ago, _Vlad said: I don't really need a code to work just an idea of how I could do the code by myself. Ya, but you got me hook. So I didn't work (having fun) for nothing : expandcollapse popup#include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <Math.au3> Opt("MustDeclareVars", True) Global Const $SIZE = 400, $BORDER = 50, $RADIUS = ($SIZE - 2 * $BORDER) / 2, $CIRCLE_SIZE = 4 _GDIPlus_Startup() Example() Func Example() Local Const $aDegree = [10, 92, 318, 323, 325, 327] Local $hGUI = GUICreate("GDI+", $SIZE, $SIZE) GUISetState(@SW_SHOW) Local $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) Local $hPen = _GDIPlus_PenCreate(0xFFFF0000, $CIRCLE_SIZE) _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsDrawEllipse($hGraphic, $BORDER, $BORDER, $SIZE - $BORDER * 2, $SIZE - $BORDER * 2, $hPen) Local $radian, $x, $y For $i = 0 To UBound($aDegree) - 1 $radian = _Radian(Mod(450 - $aDegree[$i], 360)) $x = Round($RADIUS * Cos($radian)) + $SIZE / 2 - $CIRCLE_SIZE $y = $SIZE / 2 - Round($RADIUS * Sin($radian)) - $CIRCLE_SIZE _GDIPlus_GraphicsFillEllipse($hGraphic, $x, $y, $CIRCLE_SIZE * 2, $CIRCLE_SIZE * 2) Next Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) EndFunc ;==>Example Edited August 28, 2021 by Nine Danyfirex and robertocm 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now