is that correct to in golang to calculate points on left and right side of some point…
- User
is that correct to in golang to calculate points on left and right side of some point with offset 2m on each side, and known heading:
func offsetPoint(lat, lng, course float64) (leftLat, leftLng, rightLat, rightLng float64) { METERS_PER_DEG_LAT = 111132.95 // Ok. 111.13 km METERS_PER_DEG_LON = 68516.48 // Ok. 68.5 km na 52°N OFFSET = 2.0 // 4m width, 2m on left and 2m on right
code// kurs w stopniach headingRad := course * math.Pi / 180 dx := OFFSET * math.Sin(headingRad) / METERS_PER_DEG_LON dy := OFFSET * math.Cos(headingRad) / METERS_PER_DEG_LAT leftLng = lng - dx leftLat = lat + dy rightLng = lng + dx rightLat = lat - dy return Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.