Instantiate Object at edge of mouse position instead of at the center

I’m working on a prototype of a game where you draw with your finger and a wall segment is created at the angle between points A and B (the wall has a fixed length of X, but the angle is whatever angle you swiped at). This works pretty well except for the prefab is being instantiated with its center at point A. How can I instantiate this object such that the object starts at point A, instead of the center being at point A?

Thanks!

One easy solution might be parenting the object where its pivot point would fall into center of the parent object.

With a quick Google search, a youtube video can be seen: Creating Custom Pivots in Unity - YouTube

Another solution would be calculating length of the object, and updating its transform with half of the length.
Since object is at A, move half of the length to B, which will be a new target value.
Or instead of creating the object at A, just create it at A+B (these are vector summation).