package
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Jul 6, 2023
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Point struct {
X, Y int
}
Point represents a 2D point
NewPoint creates a new Point object with the given x and y coordinates.
Example usage: p := NewPoint(3, 5)
Distance calculates the euclidean distance between two points in 2D space.
Example:
p := &Point{X: 1.0, Y: 2.0}
q := &Point{X: 3.0, Y: 4.0}
dist := p.Distance(q)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.