I want to rotate an arc around a point. ..(image 2)
I have done this using the following code.


var turn := 0.0
var radius :=250.0
var speed := 0.25
var angle := 0.0
var str_angle = 5.0


var center 

# Called when the node enters the scene tree for the first time.
func _ready():
	
	var screen_size = get_viewport_rect().size / 2
	center =  screen_size



# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta:float) :
	position = center + Vector2 (
		-sin (angle * speed) ,
		cos (angle * speed)
	) * radius

func _input(event) :
	if event is InputEventMouseMotion : 
		turn += 1
		angle = turn * deg2rad(str_angle)
		#self.look_at(center)
		#self.rotation_degrees = 5

But the arc angle is not proportional to the center of rotation... (image 1)

I tried to fix the error using the look_at command, but it didn't work
please help me !!!
Thanks.

This is a simple script I wrote to make a sprite move in a circle:

extends Node2D

var center_point
var radius = 160
var angle = 0
var speed = 4
onready var player = get_node("Player")

func _ready():
	center_point = get_viewport_rect().size / 2.0
	
func _process(delta):
	player.position = center_point + Vector2(cos(angle), sin(angle)) * radius
	angle += speed * delta

If you want a particular arc, then you just need to start angle at a particular number, like 90 degrees (in radians).

This part of your code looks strange:

turn += 1
angle = turn * deg2rad(str_angle)

You want turn inside the deg2rad function, and also you probably want to jump by 90 degrees, not 5.

var turn := 0.0
var str_angle = 90.0
...
turn += 1.0
angle = deg2rad(turn * str_angle)

    cybereality

    thanks for reply ...
    I think I failed to explain the problem !!!(i can't speak english i use google translate)
    I want something similar to the animation below :

    But I have the following problem :

    ....
    Actually my problem is setting the direction of the arc towards the center of rotation, while rotating around that point.
    The look_at command did not solve my problem...
    thanks

    What is the arc, is it a sprite? You can just rotate it:

    rotation = deg2rad(90.0)

      cybereality But also remember to set the pivot of the sprite at the "center of the circle" from which the arc is made.

      From your image, the pivot point of the sprite is in the center of the sprite. The code should work.