python - Checking a variable -


Currently I have a code that leads to vectors and creates one-third:

 < Code> b category (2047): For a boundary (B + 1,2048): Vector 1 = (L [B] [0], L [B] [1], L [B] [2]) Vector 2 = (L [A] [0], L [A] [1], L [A] [2]) X = Vector 1 Y = Vector 2 Vector 3 = List (NP. Array (X) - NP Array (Y)) Dot Product = Decrease (Operator.ed, map (operator.mult, vector3, vector3)) DP = dot product ** 5.Data_Point = DPB N = Int (DP / Bin_vidth) if the owner & lt; Num_bins: bins [bin] [2] + = 1.0 / bin_volumes [bin]   

ps b = 36771.881 but I want to say that if (vector 3 dot product with b) (b Dot product b) / 2 then vector 3 = vector 3 - b

and (vector 3 dot product B) (B-dot product with B) / 2

> Then vector 3 = vector 3 + b

How do I add it to my loop, so that it will check vector 3 for these two conditions for each vector 3?

The package is being used:

  Import operator import matplotlib.pyplot plt as import npg as numpy   

Current Code:

  Border for Border = 36771.881 (2047): For a boundary (B + 1,2048): Vector 1 = (L [B] [0], L [B] [1], L [B] [2]) Vector 2 = (L [A] [0], L [A] [1], L [A] [2]) x = Vector 1 Y = Vector 2 Vector 3 = List (NP Array (X) - NP Array (Y)) DotProduct = Low (operator.ad, map (operator.multiple, vector3, vector3)) DP = dot Roadct ** .5 data_points = dp if np.dot (data_points, cement) & gt; (NP.DOT (boundary, border) DP = DP - boundary bin = int (DP / bin_width) if bin    

two Examples include a and b , numpy.dot for internal products ("dot product").

Example ,

 > np as import np>> gt = np.array ([4,5,6])> Gt; & gt; y = np.array ([1,2,3])>> gt; gt; np. dot (x, y), 32>> gt; gt; & gt; np.de ( X, y) == (x * y) .sum () is true    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -