ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / Coordinate2D Structure / Addition Operator
Example

In This Topic
    Addition Operator (Coordinate2D)
    In This Topic
    Constructs a new Coordinate2D by adding two Coordinate2D objects. Vector addition is used.
    Syntax
    Public Operator +( _
       ByVal a As Coordinate2D, _
       ByVal b As Coordinate2D _
    ) As Coordinate2D
    public Coordinate2D operator +( 
       Coordinate2D a,
       Coordinate2D b
    )

    Parameters

    a
    b

    Return Value

    A newly constructed Coordinate2D by adding the components of the two Coordinate2D objects together.
    Example
    2D Vector Operations
    {
      Coordinate2D v = new Coordinate2D(0, 1);
      // v.Magnitude = 1
    
      Coordinate2D other = new Coordinate2D(-1, 0);
      double dotProduct = v.DotProduct(other);
      // dotProduct = 0
    
      Coordinate2D w = v + other;
      // w = (-1, 1)
    
      w += other;
      // w = (-2, 1)
    
      w -= other;
      // w = (-1, 1)
    
      w = v;
      w.Rotate(Math.PI, other);
      // w = (-2, -1)
    
      w = other;
    
      w.Scale(-4);
      // w = (4, 0)
      // w.Magnitude = 4
    
      w.Move(-1, 4);
      // w = (3, 4)
      // w.Magnitude = 5
    
      w.Move(-6, -1);
      Tuple<double, double> components = w.QueryComponents();
      // components = (-3, 3)
      // w.Magnitude = 3 * Math.Sqrt(2)
    
      Coordinate2D unitVector = w.GetUnitVector();
      // w = (-Math.Sqrt(2) / 2, Math.Sqrt(2) / 2)
      // w.Magnitude = 1
      w.SetComponents(3, 4);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also