Calculating Z coordinate from X coordinate and angle

hi

i trying to resolve problem how to scale game object. i have gameobject and im instantiating 4 arrows at the sides of gameobject to scale in direction showed by arrow. there is no problem when game object has no rotation (rotation 0,0,0). because gameobject can change rotation only around y, so scaling is only in plane xz and i only changing position of arrow in axis x or z. but when i rotate object in some angle i need to calculate for example y coordinate from actual x coordinate and actual rotation of object. so the arrow will follow actual angle of object. i tryed sin and cosine function but this not work properly

y = x / (Mathf.Sin(object.transform.eulerAngles.y * Mathf.Deg2Rad) * Mathf.Cos(object.transform.eulerAngles.y * Mathf.Deg2Rad));

is there any other way to calculate it?

Instead of doing trigonometry, why not just change the local scale and local position?

it doesnt works with local scale, or i cant find proper solution with local scale. if you have some idea just share with me. problem is that object and arrow are diferent object, and when i scaling objject i need to drag arrow in direction with angle of rotation

Hi domko! You mean to scale something like this?