Skip to content

Add concept exercise robot-revolution - #1135

Open
depial wants to merge 5 commits into
exercism:mainfrom
depial:robot-revolution
Open

Add concept exercise robot-revolution#1135
depial wants to merge 5 commits into
exercism:mainfrom
depial:robot-revolution

Conversation

@depial

@depial depial commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This is a shot at an exercise for the concept Linear Algebra Basics. Testing is still incomplete until we settle on the final form of the tasks. I've tried to keep it very simple and light on math.

Currently task:

  1. Requires normalizing vectors and converting a vector of vectors into a matrix.
  2. Uses a rotation matrix and matrix multiplication.
  3. Encourages the use of a dot product.
  4. Elementwise addition between a vector and matrix (i.e. broadcasting).
  5. Scaling and addition of two vectors.

Some considerations:

  • I couldn't think of a way to include a transpose operation in this, so I left that out.
  • I could see including a cross product in a torque calculation related to the rotation of the robot, but I'm not sure if we already have enough, but tasks 4 and 5 are similar enough that I could see dropping one.
  • Task 1 could be dropped if we make normalization a requirement in Task 3.

I'm open to any and all suggestions, since this is a first go at this, and it could likely use a bit of iteration.

@depial

depial commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

I have no idea how feed-forward made its way into this branch, but it's a bit disconcerting. I've deleted the file, so I hope that's enough...

On a related note, I decided to abandon that idea for the concept exercise because it felt kinda square-peg-round-holeish. I'm hoping this is a bit more in tune with things.

@depial
depial requested a review from colinleach August 4, 2026 18:14
@colinleach

Copy link
Copy Markdown
Contributor

This looks like a great starting point.

For now, I'll just add a few nit-picky comments. We can discuss more substantive stuff when I've had chance to think about it.

## 3. Check for Correct Orientation
- This can be checked with a dot product.
- It might be helpful to normalize the vectors.
- The following identity could be helpful: `x⋅y = ||x||||y||cos(θ)`

@colinleach colinleach Aug 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed the norm, but not this notation: ||x||. Plus it's hard to read in Markdown, so maybe add a space in the middle?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added an asterisk in between and ||x|| = norm(x) afterwards.

@@ -0,0 +1,22 @@
# Hints

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A reminder for the future: we'll need to add links once the tasks are finalized. Obvious, but lest we forget...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a few links for the functions I mention in task 1, but we can add others later.

Comment thread exercises/concept/robot-revolution/.docs/instructions.md Outdated
Next, we need functionality on how to change the direction of motion.
To do this, we need to rotate the robot to face where it wants to go.

Implement the `rotaterobot(orientation, θ)` function, which takes the robot's orientation matrix and an angle `θ` to rotate around.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Introduction talks about anti-clockwise rotation, but here it may be worth clarifying that it is a left turn.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone with an italicized counterclockwise to be clearer.

@colinleach

Copy link
Copy Markdown
Contributor

I could see including a cross product in a torque calculation related to the rotation of the robot

I'd support this. A bit mathy, but this seems an especially good place to be mathy if anywhere is.

@colinleach

Copy link
Copy Markdown
Contributor

We can discuss more substantive stuff when I've had chance to think about it.

Thinking is (even) slower than usual today.

@depial

depial commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Thinking is (even) slower than usual today.

No worries, get some rest! I'm in no hurry. Especially since I find that letting things like this sit for a bit helps the concept crystalize. Otherwise I end up wanting to change stuff after the fact 😅

I'd support this.

I'll leave the attempt at the cross product task for after we decide more concretely whether to include it or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants