DEV Community

Cover image for Subtracting Vectors
AI_Dosage
AI_Dosage

Posted on

Subtracting Vectors

Key Concept:

  • Vector subtraction involves subtracting corresponding components of two vectors.

  • If x=[x1,x2] and y=[y1,y2], then:

x−y=[x1−y1, x2−y2]
Enter fullscreen mode Exit fullscreen mode
  • The result is a new vector representing the displacement from y to x

Example: Subtract Vectors x=[2,3] and y=[−4,−2]

1. Given vectors:

  • x=[2,3]
  • y=[−4,−2]

2. Subtraction formula:

x−y = [x1−y1, x2−y2]
Enter fullscreen mode Exit fullscreen mode

3. Component-wise subtraction:

x−y=[2−(−4),3−(−2)]
Enter fullscreen mode Exit fullscreen mode

4. Simplify:

x−y=[2+4,3+2]=[6,5]
Enter fullscreen mode Exit fullscreen mode

5. Result:

 x−y=[6,5]
Enter fullscreen mode Exit fullscreen mode

Observations:

Subtracting x effectively adds the opposite of y to x.
The result [6,5] represents the displacement vector between
x and y.

subtraction-example

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay