timsta97 Posted July 30, 2009 Posted July 30, 2009 If I have a point (50, 30) How would I get an inverted point in the same quadrant (Quadrant I)? Let's say the quadrant is (100, 100)
timsta97 Posted July 30, 2009 Author Posted July 30, 2009 So you want to enter (50, 30) and get back (30, 50)? This code will do that, but it has absolutely no error checking. Local $point = InputBox("Enter a point", "Format: (x, y)" & @CRLF & "Min: 100" & @CRLF & "Max: 100") MsgBox(64, "The inverted point's coordinates are:", _InvertPoint($point)) Func _InvertPoint($sPoint) Local $aPoint = StringSplit(StringRegExpReplace(StringStripWS($sPoint, 8), "\(|\)", ""), ",", 2) $sPoint = "(" & $aPoint[1] & ", " & $aPoint[0] & ")" Return $sPoint EndFunc Thanks, this code is great, If I need to I could try to add some error checking.
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