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

  • SEARCH
  • Home
  • 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 7947795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:32:07+00:00 2026-06-04T01:32:07+00:00

First of all, i have an output array like this (in the matrix of

  • 0

First of all, i have an output array like this (in the matrix of 4×1) :

   array([[ -2.22044605e-15],
   [  2.82842712e+01],
   [ -2.22044605e-15],
   [  2.82842712e+01]])

and that output, i receive from return value of matrix multiplication of 4×3 and 3×1 just like below:

def inverse_kinematic(self,Degree):
    # [W] = (1/r)[R][V] 
    self.R = array ( [[-1, 1, self.X1+self.Y1], [1, 1, self.X2-self.Y2],
                       [-1, 1, self.X3+self.Y3], [1, 1, self.X4-self.Y4]]) 

    self.V = array ( [[self.Vt*math.cos(math.radians(Degree))],
                       [self.Vt*math.sin(math.radians(Degree))],[ self.Wv]])
    self.W = []
    self.W = (1/self.r)*dot(self.R,self.V)
    return self.W

and i really want to have and output array like above but in two digit decimal value, like this:

   array([[ 0.00],
   [  28.28],
   [ 0.00],
   [  28.28]])

i have tired to use something like “%.2f” % (number) method and still not success. i wondering is there any best method to set decimal values in list of arrays?

Best Regards,

Glenn

  • 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-04T01:32:09+00:00Added an answer on June 4, 2026 at 1:32 am

    Your return values are of very different orders:

    2.82842712e+01 approximately 2.8

    -2.22044605e-15 = 0.0000000000000022 approximately 0

    It is likely that you have a numeric evaluation that is analytically zero and the small value is just a computation error.

    Matrix operations are easily done in numpy, you could use something like this:

        >>> import numpy as np
        >>> a = np.array([[11,12,13],[21,22,23],[31,32,33],[41,42,43]])
        >>> b = np.array([[1],[2],[3]])
        >>> x = np.dot(a,b)
        >>> x
        array([[ 74],
       [134],
       [194],
       [254]])
    

    In that case you might be happy with

        >>> x = np.array([0.923423,0.12341235,0.213453241])
        >>> x.round(2)
        array([ 0.92,  0.12,  0.21])
    

    numpy arrays are convenient, because you don’t have to iterate over their entries:

        >>> a = np.array([1,2,3,4,5])
        >>> a
        array([1, 2, 3, 4, 5])
        >>> a+2
        array([3, 4, 5, 6, 7])
        >>> a*10
        array([10, 20, 30, 40, 50])
        >>> np.sin(a)
        array([ 0.84147098,  0.90929743,  0.14112001, -0.7568025 , -0.95892427])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dataset obtained from MySQL that goes like this: Array ( [0]
first of all, i like to say that i have read the other two
First of all I have searched many times in this forum but none is
First of all i have to clear few things 1.This is not spam group
First of all let me tell you that i have read the following questions
First of all, I have to say that I'm going to talk about System.ComponentModel.Component
I have a legacy DLL written in C that I'd like to call from
I am parsing text output from a disk array that lists information about LUN
First of all I have to say I am new to iOS development. My
First of all i have frames on my SD Card and frames are there

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.