@mohammed_raufshaikh here's a snippet the will help you find the new point using latitude, longitude, bearing and radius (distance). That should at least get you started. Once you have the new point you can draw a polyline using the beginning and ending points. Here's a sample that demonstrates the concepts for creating a line (see item number 3 and 4): https://developers.arcgis.com/javascript/latest/sample-code/intro-graphics/.
function bearingDistance(lat, lon, radius, bearing){
let lat1Rads = toRad(lat);
let lon1Rads = toRad(lon);
const R_KM = 6371; // radius in KM
let d = radius/R_KM; //angular distance on earth's surface
let bearingRads = toRad(bearing);
let lat2Rads = Math.asin(
Math.sin(lat1Rads) * Math.cos(d) + Math.cos(lat1Rads) * Math.sin(d) * Math.cos(bearingRads)
);
let lon2Rads = lon1Rads + Math.atan2(
Math.sin(bearingRads) * Math.sin(d) * Math.cos(lat1Rads),
Math.cos(d) - Math.sin(lat1Rads) * Math.sin(lat2Rads)
);
return {
latitude: toDeg(lat2Rads),
longitude: toDeg(lon2Rads)
}
}