I need to make rectangle given a segment as a base and check whether something (stop, another home)is inside this rectangle or not. Is there some code already written regarding this? If it is already there where I can find it in the core?