module HexaPDF:: Utils:: GraphicsHelpers
This module provides some helper functions for graphics.
Public Instance Methods
Calculates and returns the requested dimensions for the rectangular object with the given width and height based on the following: options:
rwidth-
The requested width. If
rheightis not specified, it is chosen so that the aspect ratio is maintained. In case ofwidthbegin zero,heightis used for the height. rheight-
The requested height. If
rwidthis not specified, it is chosen so that the aspect ratio is maintained. In case ofheightbegin zero,widthis used for the width.
Given two points p0 = (x0, y0) and p1 = (x1, y1), returns the point on the line through these points that is distance units away from p0.
v = p1 - p0
result = p0 + distance * v/norm(v)