Turfjs / Turfjs/turf

@turf/ellipse Construction

Open
#2,908 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

@turf/ellipse
Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

turf version: 7.2.0

turf.ellipse(...) should produce the same result as turf.circle(...) when the xSemiAxis equals the ySemiAxis and these equal the circle radius:

turf.ellipse([-122.3104, 47.6627], 10.0, 10.0, { steps : 12 });

Image

notice the varying side lengths of the construction that results from the ellipse call vs the circle call (circle shown in red below).

turf.circle([-122.3104, 47.6627], 10.0, { steps : 12 });

Image

The initial angle of construction also differs (case with 6 sides below):

Image

Further more, the construction of an ellipse whose xSemiAxis and ySemiAxis are almost equal, should also produce a result that's ver close to the result of truf.circle(...). i.g. turf.ellipse([-122.3104, 47.6627], 10.0, 9.999, { steps : 12 });.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the @turf/ellipse and @turf/circle implementations and compare their generated coordinates for equal and nearly equal axes. Add regression coverage for the examples in the issue, including the requested initial angle and side lengths, and confirm the ellipse output matches or closely approximates circle output.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.