-
-
Save practicingruby/8043103 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def ellipse(point, r1, r2 = r1) | |
| x, y = point | |
| l1 = r1 * KAPPA | |
| l2 = r2 * KAPPA | |
| create_path do |path| | |
| path.move(x + r1, y) | |
| .curve(x, y + r2, x + r1, y + l2, x + l1, y + r2) | |
| .curve(x - r1, y, x - l1, y + r2, x - r1, y + l2) | |
| .curve(x, y - r2, x - r1, y - l2, x - l1, y - r2) | |
| .curve(x +r1, y, x + l1, y - r2, x + r1, y - l2) | |
| .move(x,y) | |
| end | |
| end | |
| def create_path | |
| yield PDF::Core::Path.new(current_page) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment