// Rotate image.
558919
func (image *Image) Rotate(param *RotateParam) *Image {
	return image.setActionParam(RotateOperation, param)
}
784445
func (l Line) Rotated(around Vec, angle float64) Line {
	// Move the line so we can use `Vec.Rotated`
	lineShifted := l.Moved(around.Scaled(-1))

	lineRotated := Line{
		A: lineShifted.A.Rotated(angle),
		B: lineShifted.B.Rotated(angle),
	}

	return lineRotated.Moved(around)
}
518289
func RotateFile() error {
	logger := FromContext(context.Background())

	if logFile == nil && logFilePath == "" {
		logger.Debug("Traefik log is not writing to a file, ignoring rotate request")
		return nil
	}

	if logFile != nil {
		defer func(f *os.File) {
			_ = f.Close()
		}(logFile)
	}

	if err := OpenFile(logFilePath); err != nil {
		return fmt.Errorf("error opening log file: %s", err)
	}

	return nil
}
522787
func (c *FakeImages) Update(imageResource *image.Image) (result *image.Image, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootUpdateAction(imagesResource, imageResource), &image.Image{})
	if obj == nil {
		return nil, err
	}
	return obj.(*image.Image), err
}
543161
func (vec *T) Rotated(angle float64) T {
	sinus := math.Sin(angle)
	cosinus := math.Cos(angle)
	return T{
		vec[0]*cosinus - vec[1]*sinus,
		vec[0]*sinus + vec[1]*cosinus,
	}
}
1355021
func (gc *StackGraphicContext) Rotate(angle float64) {
	gc.current.Tr.Rotate(angle)
}
728438
func (cr *Context) Rotate(angle float64) {
	C.cairo_rotate(cr.Ptr, C.double(angle))
	if err := cr.status(); err != nil {
		panic(err)
	}
}
43015
func SetRotateSize(rotateSize int64) {
	singltonLock.RLock()
	defer singltonLock.RUnlock()

	blog.SetRotateSize(rotateSize)
}
1304546
func (image *Image) Format(param *FormatParam) *Image {
	return image.setActionParam(FormatOperation, param)
}
430294
func (image *Image) Resize(param *ResizeParam) *Image {
	return image.setActionParam(ResizeOperation, param)
}
1103301
func (writer *FileLogWriter) Rotate() {
	if writer.wr == nil {
		err := os.MkdirAll(filepath.Dir(writer.config.StorePath), 0666)
		if err != nil {
			panic(fmt.Sprintf("创建日志目录[%s]失败:%s", filepath.Dir(writer.config.StorePath), err))
		}
		fileInfo, err := os.Stat(writer.config.StorePath)
		if err == nil && fileInfo.Size() != 0 {
			bakName := writer.config.StorePath + "." + strconv.FormatInt(time.Now().Unix(), 10)
			err := os.Rename(writer.config.StorePath, bakName)
			if err != nil {
				panic(fmt.Sprintf("备份老的日志文件失败:%s", err))
			}
		}
		writer.wr, err = os.OpenFile(writer.config.StorePath, os.O_CREATE|os.O_RDWR, 0666)
		if err != nil {
			panic(fmt.Sprintf("打开日志文件失败,%s", err))
		}
	} else {
		writer.wr.Close()
		bakName := writer.config.StorePath + "." + strconv.FormatInt(time.Now().Unix(), 10)
		err := os.Rename(writer.config.StorePath, bakName)
		if err != nil {
			Error(fmt.Sprintf("循环备份老的日志文件失败:%s", err))
		}
		file, err := os.Create(writer.config.StorePath)
		if err != nil {
			//日志创建失败直接让程序挂掉
			println(fmt.Sprintf("创建日志文件失败:%s", err))
			panic(fmt.Sprintf("创建日志文件失败:%s", err))
		}
		writer.wr = file
		go clearLog(writer.config.StorePath, writer.config.Rotate)
	}
}
1324883
func (quat *T) RotateVec3(v *vec3.T) {
	qv := T{v[0], v[1], v[2], 0}
	inv := quat.Inverted()
	q := Mul3(quat, &qv, &inv)
	v[0] = q[0]
	v[1] = q[1]
	v[2] = q[2]
}
178051
func rotate(data Interface, a, m, b int) {
	i := m - a
	j := b - m

	for i != j {
		if i > j {
			swapRange(data, m-i, m, j)
			i -= j
		} else {
			swapRange(data, m-i, m+j-i, i)
			j -= i
		}
	}
	// i == j
	swapRange(data, m-i, m, i)
}
1365676
func (h *Handler) Rotate() error {
	var err error

	if h.file != nil {
		defer func(f *os.File) {
			f.Close()
		}(h.file)
	}

	h.file, err = os.OpenFile(h.config.FilePath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0664)
	if err != nil {
		return err
	}
	h.mu.Lock()
	defer h.mu.Unlock()
	h.logger.Out = h.file
	return nil
}
626829
func (vec *T) Rotate(angle float64) *T {
	*vec = vec.Rotated(angle)
	return vec
}
787094
func (mc *MembershipChanges) Rotated() bool {
	return len(mc.AddedNodes) == 1 && len(mc.RemovedNodes) == 1
}
570808
func (ir *ImageWriter) Image() (image.Image, error) {
	if ir.rgba != nil {
		return ir.rgba, nil
	}
	if ir.contents != nil && ir.contents.Len() > 0 {
		return png.Decode(ir.contents)
	}
	return nil, errors.New("no valid sources for image data, cannot continue")
}