Skip to content

Commit f2a3623

Browse files
committed
docs(readme): show npoints is optional, defaults to 100
1 parent 86e5376 commit f2a3623

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ npm install arc
2222
```js
2323
import { GreatCircle } from 'arc';
2424
const gc = new GreatCircle({x: -122, y: 48}, {x: -77, y: 39});
25-
const line = gc.Arc(100);
25+
const line = gc.Arc(); // npoints is optional, defaults to 100
2626
console.log(line.json()); // GeoJSON output
2727
```
2828

@@ -64,11 +64,12 @@ const gc = new GreatCircle(start, end, { name: 'Seattle to DC' });
6464

6565
#### 3. Generate the arc
6666
```js
67-
const line = gc.Arc(100);
67+
const line = gc.Arc(); // defaults to 100 points
68+
const line = gc.Arc(500); // or specify a custom value
6869
```
6970

7071
**Parameters:**
71-
- `npoints` (number): Number of intermediate points (higher = more accurate)
72+
- `npoints` (number, optional): Number of intermediate points (higher = more precise, default: 100)
7273

7374
### TypeScript Support
7475

@@ -86,7 +87,7 @@ const end: CoordinatePoint = { x: -77, y: 39 };
8687
const properties: RouteProperties = { name: 'Seattle to DC', color: 'blue' };
8788

8889
const gc = new GreatCircle(start, end, properties);
89-
const line = gc.Arc(100);
90+
const line = gc.Arc(); // npoints is optional, defaults to 100
9091

9192
// Fully typed return values
9293
const geojson = line.json(); // GeoJSONFeature

0 commit comments

Comments
 (0)