Xref: utzoo comp.sys.mac.games:1881 comp.sys.mac.programmer:19101 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ns-mx!alesi.cipl.uiowa.edu!wolf From: wolf@alesi.cipl.uiowa.edu (Mike Wolf) Newsgroups: comp.sys.mac.games,comp.sys.mac.programmer Subject: Re: Finding distances on map sheets Message-ID: <3231@ns-mx.uiowa.edu> Date: 16 Nov 90 18:22:12 GMT References: <532@caslon.cs.arizona.edu> <46603@apple.Apple.COM> Sender: news@ns-mx.uiowa.edu Followup-To: comp.sys.mac.games Organization: Cardiovascular Image Processing Laboratory, U of Iowa Lines: 25 I don't see any trick here. When using hex or squares or what not. The distanc you want is most likely from the center of you sector unit, correct? Why would you want to take the distance from one side of a hex to another, that would be just like going from the center of the first one to the center of the second hex. Anyway....simple math will give you the width of your hex, from opposing sides (not vertices mind you). In your code for finding the distance you could use the starting pixel point and the end pixel point to find your dX and dY. From the width of the hex you got you can tell how many pixels it took to cross that width, then you can scale this to what ever your map is and use some simple algebra to get the distance between the pixels (just find the length of the hypotenuse of the triangle created with your two points). If you cannot follow me very well, let me know and I will whip up some simple sample code (given that you tell me what you are exactly wanting and trying to do) Michael Reply to WOLF@MEL.CIPL.UIOWA.EDU