# relative coordinate or local coordinate

Hi,

I'd like to ask that if there is relative coordinate or local coordinate so that we can generate spheres around a point/sphere whose coordinate is known. For example:

There is a sphere at (0,0,0), radius=0.5

s1=utils.

I want to generate another sphere at the right-up-60 degrees location relative to s1 and contact to s1, for instance:

s2=utils.

can we do this by adding the second sphere(s2) at the upper of s1 like:

s2=utils.

and then rotate the two sphere for a certain degree (30 degree in this case)

I think it may relate to the relative coordinate or local coordinate.

Thank you in advance!

## Question information

- Language:
- English Edit question

- Status:
- Solved

- For:
- Yade Edit question

- Assignee:
- No assignee Edit question

- Solved by:
- Jan Stránský

- Solved:
- 2019-08-11

- Last query:
- 2019-08-11

- Last reply:
- 2019-08-10

Jan Stránský (honzik) said : | #1 |

something like this?

###

def rotateAround(

d = point - center

q = Quaternion(

d = q*d

return center + d

#

s1 = sphere(

# center of s2 given relatively to center of s1

s2 = sphere(

# center of s2 is rotated

s2.state.pos = rotateAround(

print s1.state.pos

print s2.state.pos

###

cheers

Jan

Leonard (z2521899293) said : | #2 |

Thanks Jan Stránský, that solved my question.