Hi!
I did not find any method provided by the Turf lib which handle my case.
In fact, I have:
Basically I want to generate and ArcByCenterPoint with those data.
Is it possible ?
Thanks.
Hi!
I just tested the turf-sector method and obviously there is a misunderstanding. Well the method itself is working perfectly but this is not what I requested.

In fact I got a circle sector but what I want is ONLY the line Arc not the entire sector :)
Thanks!
I don't think there's any misunderstanding, what @stebogit implemented lines up perfectly with https://github.com/Turfjs/turf/issues/155.
This new module request would be called @turf/line-arc which would have this as a result (red line):

@Adraesh Feel free to send a PR to TurfJS if you want specific modules implemented.
Thanks Denis, but what I wanted to say is that my post can't be referenced to the turf-sector module newly implemented :)
@DenisCarriere @Adraesh I can easily implement a turf-arc-line module simply extracting a currently private function inside the sector module.
Hey stebogit!
I believe you are talking about this method:
function getArcLine(center, radius, angle1, angle2, steps, units)
It would be really appreciated if you can do that.
Thank you very much.
馃憤 @stebogit Sounds like a plan, afterwards you can add @turf/line-arc as a dependency to @turf/sector.
Thanks to @stebogit @turf/line-arc is now available on npm.
Tanks also to @DenisCarriere! 馃憤
I'll add @turf/line-arc as a dependency to @turf/sector then.
I'm using a <Layer> and a <Feature> from react-mapbox-gl to draw a line from Point A to Point B ( see screenshot 1)
My goal is to use line-arc and center from turf js in order to have a curved line between point A and point B
I managed to get a curved line, but it's not starting at Point A and it's not finishing at Point B... it is instead drawn in the middle of the map (see screenshot number 2)
Here is my code
const features = turf.featureCollection([
turf.point(this.state.startFlying), // [-122.3811441, 37.6213129]
turf.point(this.state.destinationFlying), // [-118.4107187, 33.9415889]
]);
const theCenter = turf.center(features);
const arcRadius = 5;
const bearing1 = 25;
const bearing2 = 47;
const arc = turf.lineArc(theCenter, arcRadius, bearing1, bearing2);
const mappedCurvedFlyingCurve = arc.geometry.coordinates;



Most helpful comment
Hey stebogit!
I believe you are talking about this method:
function getArcLine(center, radius, angle1, angle2, steps, units)
It would be really appreciated if you can do that.
Thank you very much.