Difference between revisions of "Xojo.Core.Point.Negate"

From Xojo Documentation

(Created page with "{{MethodBox | name = Operator_Negate | ownertype = class | scope = public | parameters = | owner = Xojo.Core.Point | returntype = Xojo.Core.Point }} {{Description | t...")
 
 
Line 12: Line 12:
 
Negate an existing point to get a new point:
 
Negate an existing point to get a new point:
 
<rbcode>
 
<rbcode>
Dim p1 As New Xojo.Core.Point(50, 50)
+
Var p1 As New Xojo.Core.Point(50, 50)
Dim p2 As Xojo.Core.Point
+
Var p2 As Xojo.Core.Point
  
 
p2 = -p1 // p2 is (-50, -50)
 
p2 = -p1 // p2 is (-50, -50)
 
</rbcode>
 
</rbcode>

Latest revision as of 17:38, 11 August 2019

Method

Xojo.Core.Point.Operator_Negate() As Xojo.Core.Point

Supported for all project types and targets.

Use the negate operator (-) to create a new point with the X and Y coordinates negated.

Sample Code

Negate an existing point to get a new point:

Var p1 As New Xojo.Core.Point(50, 50)
Var p2 As Xojo.Core.Point

p2 = -p1 // p2 is (-50, -50)