// FromLatLng returns the LatLng projected into an R2 Point.
348575
func (p *PlateCarreeProjection) FromLatLng(ll LatLng) r2.Point {
	return r2.Point{
		X: p.fromRadians * ll.Lng.Radians(),
		Y: p.fromRadians * ll.Lat.Radians(),
	}
}
384939
func (m *Message) FromProto(p proto.Message) error {
	ptr := reflect.ValueOf(p)
	if ptr.Type() != m.typ.Type() {
		return fmt.Errorf("bad message type: got %s, expect %s", ptr.Type(), m.typ.Type())
	}

	msg := ptr.Elem()
	for name, fd := range m.typ.fields {
		// Get the field's value from the proto message as reflect.Value. For unused
		// oneof alternatives this is an invalid zero value, we skip them right
		// away. For other fields it is reflect.Value (of fd.typ type) that MAY be
		// nil inside (for unset fields). toStarlarkValue converts such values to
		// starlark.None.
		val := fd.onProtoReflection(msg, reflectFromProto)
		if !val.IsValid() {
			continue
		}
		// Convert the Go value to the corresponding Starlark value and assign it to
		// the field in 'm'.
		sv, err := toStarlarkValue(val)
		if err != nil {
			return fmt.Errorf("cannot recognize value of field %s: %s", name, err)
		}
		if err := m.SetField(name, sv); err != nil {
			return err
		}
	}

	return nil
}
284209
func intersectsLngEdge(a, b Point, lat r1.Interval, lng s1.Angle) bool {
	// The nice thing about edges of constant longitude is that
	// they are straight lines on the sphere (geodesics).
	return CrossingSign(a, b, PointFromLatLng(LatLng{s1.Angle(lat.Lo), lng}),
		PointFromLatLng(LatLng{s1.Angle(lat.Hi), lng})) == Cross
}
379248
func (l *Logger) FromCtx(ctx *gear.Context) Log {
	any, _ := ctx.Any(l)
	return any.(Log)
}
176079
func FromXAxisAngle(angle float32) T {
	angle *= 0.5
	return T{math.Sin(angle), 0, 0, math.Cos(angle)}
}
456072
func (kf *KunstructuredFactoryImpl) FromMap(
	m map[string]interface{}) ifc.Kunstructured {
	return &UnstructAdapter{Unstructured: unstructured.Unstructured{Object: m}}
}
219388
func (b *SelectBuilder) From(table string) *SelectBuilder {
	b.table = table
	return b
}
1113708
func FromZAxisAngle(angle float32) T {
	angle *= 0.5
	return T{0, 0, math.Sin(angle), math.Cos(angle)}
}
877975
func (s *UpdateByQueryService) From(from int) *UpdateByQueryService {
	s.from = &from
	return s
}
776621
func (set *TemplateSet) FromString(tpl string) (*Template, error) {
	set.firstTemplateCreated = true

	return newTemplateString(set, []byte(tpl))
}
520309
func (config *configuration) fromOptions(labels map[string]string) error {
	for label, value := range labels {
		switch label {
		case parentOpt:
			// parse driver option '-o parent'
			config.Parent = value
		case driverModeOpt:
			// parse driver option '-o ipvlan_mode'
			config.IpvlanMode = value
		}
	}
	return nil
}
168412
func (x *Exif) LatLong() (lat, long float64, err error) {
	// All calls of x.Get might return an TagNotPresentError
	longTag, err := x.Get(FieldName("GPSLongitude"))
	if err != nil {
		return
	}
	ewTag, err := x.Get(FieldName("GPSLongitudeRef"))
	if err != nil {
		return
	}
	latTag, err := x.Get(FieldName("GPSLatitude"))
	if err != nil {
		return
	}
	nsTag, err := x.Get(FieldName("GPSLatitudeRef"))
	if err != nil {
		return
	}
	if long, err = tagDegrees(longTag); err != nil {
		return 0, 0, fmt.Errorf("Cannot parse longitude: %v", err)
	}
	if lat, err = tagDegrees(latTag); err != nil {
		return 0, 0, fmt.Errorf("Cannot parse latitude: %v", err)
	}
	ew, err := ewTag.StringVal()
	if err == nil && ew == "W" {
		long *= -1.0
	} else if err != nil {
		return 0, 0, fmt.Errorf("Cannot parse longitude: %v", err)
	}
	ns, err := nsTag.StringVal()
	if err == nil && ns == "S" {
		lat *= -1.0
	} else if err != nil {
		return 0, 0, fmt.Errorf("Cannot parse longitude: %v", err)
	}
	return lat, long, nil
}
909092
func GeoPointFromLatLon(lat, lon float64) *GeoPoint {
	return &GeoPoint{Lat: lat, Lon: lon}
}
1354693
func from(b *Builder, args []string, attributes map[string]bool, flagArgs []string, original string) error {
	switch {
	case len(args) == 1:
	case len(args) == 3 && len(args[0]) > 0 && strings.EqualFold(args[1], "as") && len(args[2]) > 0:

	default:
		return fmt.Errorf("FROM requires either one argument, or three: FROM <source> [as <name>]")
	}

	name := args[0]

	// Support ARG before from
	argStrs := []string{}
	for n, v := range b.Args {
		argStrs = append(argStrs, n+"="+v)
	}
	var err error
	if name, err = ProcessWord(name, argStrs); err != nil {
		return err
	}

	// Windows cannot support a container with no base image.
	if name == NoBaseImageSpecifier {
		if runtime.GOOS == "windows" {
			return fmt.Errorf("Windows does not support FROM scratch")
		}
	}
	b.RunConfig.Image = name
	// TODO: handle onbuild
	return nil
}
1363144
func (v *Vector3d) ToLatLon(datum Datum) Coordinates {
	aa := datum.a
	bb := datum.b

	e2 := (aa*aa - bb*bb) / (aa * aa) // 1st eccentricity squared
	ε2 := (aa*aa - bb*bb) / (bb * bb) // 2nd eccentricity squared
	p := math.Sqrt(v.x*v.x + v.y*v.y) // distance from minor axis
	R := math.Sqrt(p*p + v.z*v.z)     // polar radius

	// parametric latitude
	tanβ := (bb * v.z) / (aa * p) * (1 + ε2*b/R)
	sinβ := tanβ / math.Sqrt(1+tanβ*tanβ)
	cosβ := sinβ / tanβ

	// geodetic latitude
	φ := math.Atan2(v.z+ε2*bb*sinβ*sinβ*sinβ, p-e2*aa*cosβ*cosβ*cosβ)

	// longitude
	λ := math.Atan2(v.y, v.x)

	coords := Coordinates{
		Lat: toDegrees(φ),
		Lon: toDegrees(λ),
	}

	return coords
}
157397
func FromZAxisAngle(angle float64) T {
	angle *= 0.5
	return T{0, 0, math.Sin(angle), math.Cos(angle)}
}
708070
func (s *Scheduler) FromString(gstr string) (err error) {
	*s, err = SchedulerFromString(gstr)
	return
}