# Vector 2 post code ok

**URL:** <https://mapwindow.discourse.group/t/vector-2-post-code-ok/1396>\
**Category:** MapWinGIS\
**Created:** [August 17, 2022, 9:05pm UTC](https://mapwindow.discourse.group/t/vector-2-post-code-ok/1396 "2022-08-17T21:05:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mickaelschwedler](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/mickaelschwedler/32/666_2.png) [@mickaelschwedler](https://mapwindow.discourse.group/u/mickaelschwedler)\
**Post date:** [August 17, 2022, 9:05pm UTC](https://mapwindow.discourse.group/t/vector-2-post-code-ok/1396/1 "2022-08-17T21:05:54Z")

</div>

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
using System.Threading.Tasks;

namespace WindowsFormsApp2  
{  
public class Vector2  
{  
private double x;  
private double y;

```
    public Vector2(double x, double y)
        {
        this.x = x;
        this.y = y;
        }
    public static Vector2 Zero
        {
        get { return new Vector2(0.0, 0.0); }
        }

    public double Y
        {
        get { return y; }
        set { y = value; }
        }

    public double X
        {
        get { return x; }
        set { x = value; }
        }
    public double DistanceFrom(Vector2 v)
        {
        double dx = v.X - X;
        double dy = v.Y - Y;
        return Math.Sqrt(dx * dx + dy * dy);
        }
    public System.Drawing.PointF ToPointF
        {
        get { return new System.Drawing.PointF((float)X, (float)Y); }

        }
    }
}

```

Vector2 post your code to keep a class together on MapWinGis it will help everyone ok let’s get together to exchange experiences and help each other. MapWinGis 5.3 excellent
