具体的如图,我现在数学就是小学六年纪的水平,谁能帮忙看看?关于数学方面的问题
如图,已知起点和A点,如何得出B点和C点来?B和C保持在A点的两边,A可能是任意方向,其实就是想做散弹枪子弹的射击,射出A点,附加上B和C点,就是不知如何计算B和C点的终点位置来,最好能帮忙给个代码,我数学真的就小学水平。。我知道这应该是求圆,所以捣鼓了一天的代码,结果还是有个问题无法解决,代码如下
Vec2 pos1;
auto start = m_vHeros->getPosition();
auto end = touchLocation;
auto r = start.getDistance(end);
Bullet::createWithBulletType(m_map, start , end, 0);
pos1.x = start.x + r * cos(20 * 3.14f / 180);
pos1.y = start.y + r * sin(20 * 3.14f / 180);
Bullet::createWithBulletType(m_map, start , pos1, 0);
pos1.x = start.x + r * cos(-20 * 3.14f / 180);
pos1.y = start.y + r * sin(-20 * 3.14f / 180);
Bullet::createWithBulletType(m_map, start , pos1, 0);
结果以下代码的B和C二点位置永远是固定的,我试了下应该是要20和-20那个地方应该是要动态求A的角度吧才能固定在A的两边吧?但是我不知如何做,谁能帮帮忙?