src/cplib/geometry/base

    Dark Mode
Search:
Group by:
  Source   Edit

Types

Line[T] = object
  s*, t*: Point[T]
  Source   Edit
Point[T] = object
  x*, y*: T
  Source   Edit
Segment[T] = object
  s*, t*: Point[T]
  Source   Edit

Vars

GEOMETRY_EPS = 1e-10
  Source   Edit

Procs

proc `$`[T](l: Line[T]): string
  Source   Edit
proc `$`[T](p: Point[T]): string
  Source   Edit
proc `*=`[S](p: var Point[SomeFloat]; x: S)
  Source   Edit
proc `*=`[T, S](p: var Point[T]; x: S)
  Source   Edit
proc `*`[T, S](p: Point[T]; x: S): Point[T]
  Source   Edit
proc `*`[T, S](x: S; p: Point[T]): Point[T]
  Source   Edit
proc `*`[T](p, q: Point[T]): T
  Source   Edit
proc `+=`[T](p: var Point[T]; q: Point[T])
  Source   Edit
proc `+`[T](p: Point[T]): Point[T]
  Source   Edit
proc `+`[T](p: Point[T]; q: Point[T]): Point[T]
  Source   Edit
proc `-=`[T](p: var Point[T]; q: Point[T])
  Source   Edit
proc `-`[T](p: Point[T]): Point[T]
  Source   Edit
proc `-`[T](p: Point[T]; q: Point[T]): Point[T]
  Source   Edit
proc `/=`[S](p: var Point[SomeFloat]; x: S)
  Source   Edit
proc `/=`[T, S](p: var Point[T]; x: S)
  Source   Edit
proc `/`[T, S](p: Point[T]; x: S): Point[T]
  Source   Edit
proc `<=`[T](p, q: Point[T]): bool
  Source   Edit
proc `<`[T](p, q: Point[T]): bool
  Source   Edit
proc `==`[T](p, q: Point[T]): bool
  Source   Edit
proc `>=`[T](p, q: Point[T]): bool
  Source   Edit
proc `>`[T](p, q: Point[T]): bool
  Source   Edit
proc `@`[T](p, q: Point[T]): T
  Source   Edit
proc cmp[T](p, q: Point[T]): int
  Source   Edit
proc cross[T](p, q: Point[T]): T
2点p,qの外積 (p.x * q.y - p.y * q.x)   Source   Edit
proc dot[T](p, q: Point[T]): T
2点p,qの内積 (p.x * q.x + p.y * q.y)   Source   Edit
proc geometry_eq(x, y: SomeFloat): bool
  Source   Edit
proc geometry_eq(x: int; y: SomeFloat): bool
  Source   Edit
proc geometry_eq(x: SomeFloat; y: int): bool
  Source   Edit
proc geometry_eq[T, S](x: T; y: S): bool
  Source   Edit
proc geometry_ge(x: int; y: SomeFloat): bool
  Source   Edit
proc geometry_ge(x: SomeFloat; y: int): bool
  Source   Edit
proc geometry_ge[T, S](x: T; y: S): bool
  Source   Edit
proc geometry_gt[T, S](x: T; y: S): bool
  Source   Edit
proc geometry_le(x: int; y: SomeFloat): bool
  Source   Edit
proc geometry_le(x: SomeFloat; y: int): bool
  Source   Edit
proc geometry_le[T, S](x: T; y: S): bool
  Source   Edit
proc geometry_lt[T, S](x: T; y: S): bool
  Source   Edit
proc geometry_neq[T, S](x: T; y: S): bool
  Source   Edit
proc hash[T](p: Point[T]): Hash
  Source   Edit
proc initLine[T](a, b, c: int): Line[int]
  Source   Edit
proc initLine[T](a, b, c: T): Line[T]
直線 ax + by + c = 0 の初期化、int 型に対しては使用不可   Source   Edit
proc initLine[T](s, t: Point[T]): Line[T]
2点 (s, t) を通る直線の初期化   Source   Edit
proc initPoint[T](p: (T, T)): Point[T]
点を (p[0], p[1]) で初期化   Source   Edit
proc initPoint[T](x, y: T): Point[T]
点を (x, y) で初期化   Source   Edit
proc initSegment[T](s, t: Point[T]): Segment[T]
2点 (s, t) を結ぶ線分の初期化   Source   Edit
proc norm[T](p: Point[T]): T
pのノルム (p.x * p.x + p.y * p.y)   Source   Edit
proc vector[T](l: Line[T]): Point[T]
直線の接ベクトル(直線の方向のベクトル)   Source   Edit

Converters

converter toLine[T](s: Segment[T]): Line[T]
  Source   Edit