// FromXAxisAngle returns a quaternion representing a rotation around the x axis.
176079
func FromXAxisAngle(angle float32) T {
	angle *= 0.5
	return T{math.Sin(angle), 0, 0, math.Cos(angle)}
}
980527
func PointIntersectsLine(strategy Strategy, point, lineStart, lineEnd geom.Coord) (hasIntersection bool) {
	intersectorData := &lineIntersectorData{
		strategy:           strategy,
		inputLines:         [2][2]geom.Coord{{lineStart, lineEnd}, {}},
		intersectionPoints: [2]geom.Coord{{0, 0}, {0, 0}},
	}

	intersectorData.pa = intersectorData.intersectionPoints[0]
	intersectorData.pb = intersectorData.intersectionPoints[1]

	strategy.computePointOnLineIntersection(intersectorData, point, lineStart, lineEnd)

	return intersectorData.intersectionType != lineintersection.NoIntersection
}
153238
func FromAxisAngle(axis *vec3.T, angle float64) T {
	angle *= 0.5
	sin := math.Sin(angle)
	q := T{axis[0] * sin, axis[1] * sin, axis[2] * sin, math.Cos(angle)}
	return q.Normalized()
}
1286495
func FromStatus(s *status.Status) *platform.Error {
	if s == nil || s.Code() == codes.OK {
		return nil
	}

	msg := s.Message()
	var perr platform.Error
	if err := json.Unmarshal([]byte(msg), &perr); err != nil {
		return &platform.Error{
			Err:  errors.New(msg),
			Code: platform.EInternal,
		}
	}

	return &perr
}
979239
func FromContext(ctx context.Context) (*sqs.Message, bool) {
	msg, ok := ctx.Value(sqsMessageKey).(*sqs.Message)
	return msg, ok
}
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
}
488789
func (q *ContainsVertexQuery) ContainsVertex() int {
	// Find the unmatched edge that is immediately clockwise from Ortho(P).
	referenceDir := Point{q.target.Ortho()}

	bestPoint := referenceDir
	bestDir := 0

	for k, v := range q.edgeMap {
		if v == 0 {
			continue // This is a "matched" edge.
		}
		if OrderedCCW(referenceDir, bestPoint, k, q.target) {
			bestPoint = k
			bestDir = v
		}
	}
	return bestDir
}
93592
func FromObject(obj runtime.Object) error {
	switch t := obj.(type) {
	case *unversioned.Status:
		return &StatusError{*t}
	}
	return &UnexpectedObjectError{obj}
}
204666
func HomogRotate3DX(angle float32) Mat4 {
	//angle = (angle * math.Pi) / 180.0
	sin, cos := float32(math.Sin(float64(angle))), float32(math.Cos(float64(angle)))

	return Mat4{1, 0, 0, 0, 0, cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1}
}
1096144
func FromMapElems(m interface{}) interface{} {
	inValue := reflect.ValueOf(m)
	outValue := reflect.MakeSlice(reflect.SliceOf(inValue.Type().Elem()), inValue.Len(), inValue.Len())
	for i, key := range inValue.MapKeys() {
		outValue.Index(i).Set(inValue.MapIndex(key))
	}
	return outValue.Interface()
}
1202649
func (e *EdgeCrosser) EdgeOrVertexChainCrossing(d Point) bool {
	// We need to copy e.c since it is clobbered by ChainCrossingSign.
	c := e.c
	switch e.ChainCrossingSign(d) {
	case DoNotCross:
		return false
	case Cross:
		return true
	}
	return VertexCrossing(e.a, e.b, c, d)
}
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
}
898824
func (p *MercatorProjection) FromLatLng(ll LatLng) r2.Point {
	// This formula is more accurate near zero than the log(tan()) version.
	// Note that latitudes of +/- 90 degrees yield "y" values of +/- infinity.
	sinPhi := math.Sin(float64(ll.Lat))
	y := 0.5 * math.Log((1+sinPhi)/(1-sinPhi))
	return r2.Point{p.fromRadians * float64(ll.Lng), p.fromRadians * y}
}
1285645
func (v Vector) Ortho() Vector {
	ov := Vector{0.012, 0.0053, 0.00457}
	switch v.LargestComponent() {
	case XAxis:
		ov.Z = 1
	case YAxis:
		ov.X = 1
	default:
		ov.Y = 1
	}
	return v.Cross(ov).Normalize()
}
528114
func (c *ConfigLocal) XattrStore() XattrStore {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.xattrStore
}
403162
func maxChordAngle(x s1.ChordAngle, others ...s1.ChordAngle) s1.ChordAngle {
	max := x
	for _, y := range others {
		if y > max {
			max = y
		}
	}
	return max
}
769710
func (s *SearchService) From(from int) *SearchService {
	s.searchSource = s.searchSource.From(from)
	return s
}