VBForums - Maths Forum
https://www.vbforums.com/
By popular request, a place for you to discuss Maths of all forms. Somewhere to think about algorithms and the applications of maths to programming too.enTue, 21 Sep 2021 22:55:21 GMTvBulletin60https://www.vbforums.com/images/misc/rss.pngVBForums - Maths Forum
https://www.vbforums.com/
<![CDATA[[RESOLVED] how subtrat numbers(minus)?]]>
https://www.vbforums.com/showthread.php?893127-RESOLVED-how-subtrat-numbers(minus)&goto=newpost
Tue, 24 Aug 2021 19:09:43 GMTi'm review math from scratch.
i need undertsand somethings on Math subtration(minus):
1 - how can i subtract the low number with big number: 45 -312?
2 - how can i subtract a number with several zeros?
sample 1: 3000 - 234
sample 2: 3004 - 237
]]>Maths Forumjoaquimhttps://www.vbforums.com/showthread.php?893127-RESOLVED-how-subtrat-numbers(minus)<![CDATA[[RESOLVED] Rotating an array of points clockwise 90, 180, and 270 degrees]]>
https://www.vbforums.com/showthread.php?893116-RESOLVED-Rotating-an-array-of-points-clockwise-90-180-and-270-degrees&goto=newpost
Tue, 24 Aug 2021 09:31:44 GMTI have an array of points that draws a polygon in a vertical position (All of the X and Y values are positive)...
Code:
---------
Dim points21x22() As Point = New Point() {New Point(10, 0), New Point(15, 3), New Point(18, 5), New Point(20, 8), _
New Point(20, 39), New Point(17, 42), New Point(3, 42), New Point(0, 39), _
New Point(0, 8), New Point(2, 5), New Point(5, 3), New Point(10, 0)}
---------
I can rotate this array 90 degrees clockwise...
Code:
---------
Dim newPoints() As Point = Array.ConvertAll(points21x22, Function(pt) New Point(-pt.Y, pt.X))
---------
But this results in negative values in the X coordinate which messes with my offsetting.
I can fix my offsetting...
Code:
---------
Dim o As Integer = newPoints.Min(Function(pt2) pt2.X)
newPoints = Array.ConvertAll(newPoints, Function(pt) New Point(pt.X - o, pt.Y))
---------
But this still gives an array with some negative X values.
Can someone explain how to rotate my polygons so that all of the point values are positive?, and also if this code...
Code:
---------
Dim newPoints() As Point = Array.ConvertAll(points21x22, Function(pt) New Point(pt.Y, -pt.X))
---------
Will rotate 90 degrees anticlockwise? And also, will this rotate by 180 degrees?...
Code:
---------
Dim newPoints() As Point = Array.ConvertAll(points21x22, Function(pt) New Point(pt.Y, pt.X))
---------
I have an array of points that draws a polygon in a vertical position (All of the X and Y values are positive)...

Code:

Dim points21x22() As Point = New Point() {New Point(10, 0), New Point(15, 3), New Point(18, 5), New Point(20, 8), _
New Point(20, 39), New Point(17, 42), New Point(3, 42), New Point(0, 39), _
New Point(0, 8), New Point(2, 5), New Point(5, 3), New Point(10, 0)}

I can rotate this array 90 degrees clockwise...

Code:

Dim newPoints() As Point = Array.ConvertAll(points21x22, Function(pt) New Point(-pt.Y, pt.X))

But this results in negative values in the X coordinate which messes with my offsetting.

I can fix my offsetting...

Code:

Dim o As Integer = newPoints.Min(Function(pt2) pt2.X)
newPoints = Array.ConvertAll(newPoints, Function(pt) New Point(pt.X - o, pt.Y))

But this still gives an array with some negative X values.
Can someone explain how to rotate my polygons so that all of the point values are positive?, and also if this code...

Code:

Dim newPoints() As Point = Array.ConvertAll(points21x22, Function(pt) New Point(pt.Y, -pt.X))

Will rotate 90 degrees anticlockwise? And also, will this rotate by 180 degrees?...

Code:

Dim newPoints() As Point = Array.ConvertAll(points21x22, Function(pt) New Point(pt.Y, pt.X))