vector calculation