examples

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X, Y int
}

Point represents a 2D point

func NewPoint

func NewPoint(x, y int) *Point

NewPoint creates a new Point object with the given x and y coordinates. Example usage: p := NewPoint(3, 5)

func (*Point) Distance

func (p *Point) Distance(q *Point) float64

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL