🧻
paper.js
Paper.jsTypogram
  • Paper.js API Reference
  • Global Scope
  • 3rd Party Plugins
    • paperjs-round-corners
  • Basic Types
    • Point
    • Size
    • Line
    • Rectangle
    • Matrix
  • Project & Items
    • Project
    • Item
    • Layer
    • Group
    • Shape
    • Raster
    • HitResult
  • Paths
    • PathItem
    • Path
    • CompoundPath
    • Segment
    • Curve
    • CurveLocation
  • Symbols
    • SymbolDefinition
    • SymbolItem
  • Styling
    • Style
    • Color
    • Gradient
    • GradientStop
  • Animation
    • Tween
  • Typography
    • TextItem
    • PointText
  • User Interaction & Events
    • View
    • Event
    • MouseEvent
    • Tool
    • ToolEvent
    • Key
    • KeyEvent
  • JavaScript
    • PaperScope
    • PaperScript
Powered by GitBook
On this page
  • Constructors
  • Properties
  • Methods

Was this helpful?

Edit on GitHub
  1. Basic Types

Line

The Line object represents..

Constructors

  • Line(point1, point2[, asVector, arg3, arg4])

    Creates a Line object.

    • Parameters:

    • point1: Point

    • point2: Point

    • asVector: Boolean β€” optional, default: false

    • arg3:

    • arg4:

    • Returns:

    • Line

Properties

  • point

    The starting point of the line.

    Read only.

    • Type:

    • Point

  • vector

    The direction of the line as a vector.

    Read only.

    • Type:

    • Point

  • length

    The length of the line.

    Read only.

    • Type:

    • Number

Methods

  • intersect(line[, isInfinite])

    • Parameters:

    • line: Line

    • isInfinite: Boolean β€” optional, default: false

    • Returns:

    • Point β€” the intersection point of the lines, undefined if the two lines are collinear, or null if they don’t intersect.

  • getSide(point[, isInfinite])

    • Parameters:

    • point: Point

    • isInfinite: Boolean β€” optional, default: false

    • Returns:

    • Number

  • getDistance(point)

    • Parameters:

    • point: Point

    • Returns:

    • Number

  • getSignedDistance(point)

    • Parameters:

    • point: Point

    • Returns:

    • Number

PreviousSizeNextRectangle

Was this helpful?