Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8655581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:04:03+00:00 2026-06-12T15:04:03+00:00

Background I’m trying to understand matrix transformations. (Developing plugins for SketchUp using it’s Ruby

  • 0

Background

I’m trying to understand matrix transformations. (Developing plugins for SketchUp using it’s Ruby API)

I’ve been setting up small experiments to split up the learning in small chunks so I can see what happens when I apply the various transformations and generally it’s been going well. I’m seeing how things work and I can take the rather abstract description of transformation matrices and translate them into what actually happens.

Question

But here something I’ve become stomped:

(We’re using 4×4 matrices here.)

I would like to scale a set of point along a given vector (or local coordinate system).

Say we have a square, offset [20,10] from the global origin, rotated 30 degrees. I would like to scale this square to be 2x in the X direction.

So we have a local scaling transformation:

local_scale = Geom::Transformation.scaling( 2, 1, 1 )

What I tried, and worked:

  1. Transform the points into the local coordinate system.
  2. Apply local scale transformation.
  3. Transform the points back into the global coordinate system.

I have tried this, and it works. However, I’m not happy with it. It requires me to iterate and transform my set of point three times. Doesn’t seem efficient. Remember I’m using a Ruby based API – things are slow and I am dealing with data sets of many thousands of points.

Can this be done?

Is there a way I can iterate and transform each point only once and get the correct result?

What I tried, and failed:

I tried combining the inverse transformation to the local co-ordinate with the local scaling, but that failed. (There clearly is something here about combining transformations I need to read up on – again.)

I thought that maybe this would work:

( local_coords_transformation.inverse * scaling ) * local_coords_transformation )

I thought this would transform my local scaling transformation into a transformation that worked in the global coordinate system. It didn’t – and I expect there’s a few of you shaking your heads right now.

Let me know if my explanation was unclear or if more background information is needed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:04:04+00:00Added an answer on June 12, 2026 at 3:04 pm

    Ah! Got it working! 😀

    local_coords_transformation * scaling * local_coords_transformation.inverse

    I got it wrong the first time because I didn’t realise the order of the transformation was reversed from how you’d describe it in English. When reading this Wikipeadia article I realised what was going wrong:

    http://en.wikipedia.org/wiki/Transformation_matrix#Composing_and_inverting_transformations

    In other words, the matrix of the combined transformation A followed by B is simply the product of the individual matrices. Note that the multiplication is done in the opposite order from the English sentence: the matrix of “A followed by B” is BA, not AB.

    Duh!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: At my company we are developing a bunch applications that are using the
Background: I am using node.js and express to create an API. I have implemented
Background: In Windows Vista and above, using an expanded Core Audio API (by Ray
Background: I'm using the (fantastic) Vim plugin python-mode , which includes the pep8 linter.
Background - I am using paramiko to put files on a bunch of remote
Background : I'm trying to convert some JavaScript code which uses the the Crossfilter
Background: Using unix, codeigniter from localhost. I'd like to run a controllers via a
Background info I am trying to upgrade a custom CMS to support the HTML5
Background Hi All, I'm trying to use Boost::MPI, at the moment I'm just trying
Background: I am developing an app which sends an SMS to users after registration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.