We have studied the angular dependence of the zero-field-cooled (MZFC), field-cooled (MFC), and remanent magnetization (Mrem) of YBa2Cu3O7 single crystal, by rotating the crystal relative to the applied field direction. The angular dependence of MZFC is governed only by the shape anisotropy of the crystal. Two mechanisms, namely, shape anisotropy and intrinsic anisotropy, are used to describe the angular dependence of the remanent magnetization. At sufficiently low fields and low temperatures, MFC rotates with the crystal as a rigid entity, and the relation MFC=MZFC+Mrem holds for all orientations. In the single crystal the measured and the calculated shape anisotropy ratios are equal, whereas for ceramic samples the calculated ratio is larger than the measured one.