IRONSOFTWAREHOME
Compare Two Points
using IronSoftware.Drawing;
using System;

// Instantiate 2 points using float parameter
PointF pointFloat = new PointF(22.2f, 25.7f);
PointF pointFloat2 = new PointF(30.2f, 55.7f);

// Check for equality of the double parameter between 2 points
Console.WriteLine(pointFloat.Equals(pointFloat2));
NuGet Download
PM > Install-Package IronSoftware.System.Drawing
Compare Two Points

Compare Two Points

One of the functionalities available in the Point and PointF classes is the Equals() method. This method is used to compare two points in terms of their x and y coordinates and returns a boolean value.

It's important to note that this method can only be used with Point objects of the same class. Attempting to use this method to compare two points of different classes, such as comparing Point and PointF classes, will result in a NullReferenceException being thrown at runtime.

View on GitHub

Ready to Get Started?

Nuget Downloads 19,926,787Version:2025.3just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required