CN112580213B - Method and device for generating display image of electric field lines and storage medium - Google Patents

Method and device for generating display image of electric field lines and storage medium Download PDF

Info

Publication number
CN112580213B
CN112580213B CN202011548510.4A CN202011548510A CN112580213B CN 112580213 B CN112580213 B CN 112580213B CN 202011548510 A CN202011548510 A CN 202011548510A CN 112580213 B CN112580213 B CN 112580213B
Authority
CN
China
Prior art keywords
electric field
charge
values
image pixels
transparency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011548510.4A
Other languages
Chinese (zh)
Other versions
CN112580213A (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Cut Stone Hi Tech Co ltd
Original Assignee
Beijing Cut Stone Hi Tech Co ltd
Filing date
Publication date
Application filed by Beijing Cut Stone Hi Tech Co ltd filed Critical Beijing Cut Stone Hi Tech Co ltd
Priority to CN202011548510.4A priority Critical patent/CN112580213B/en
Publication of CN112580213A publication Critical patent/CN112580213A/en
Application granted granted Critical
Publication of CN112580213B publication Critical patent/CN112580213B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

A method and device for generating a display image of electric field lines and a storage medium. The method for generating the display image of the electric field lines comprises the following steps: receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises a coordinate of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels; calculating values of a flow function of an electric field formed by at least one charge at positions corresponding to a plurality of image pixels based on parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of stream function values, respectively. The method for generating the display image of the electric field lines has the potential of improving the generation speed of the display image of the electric field lines.

Description

Method and device for generating display image of electric field lines and storage medium
Technical Field
The embodiment of the disclosure relates to a method and a device for generating a display image of electric field lines and a storage medium.
Background
The electric field lines are some imaginary curves introduced in the electric field in order to intuitively describe the electric field distribution. The tangential direction of each point on the curve is consistent with the direction of the electric field intensity of the point; the electric field intensity at the places with dense curves is high, and the electric field intensity at the places with sparse curves is low.
Electric field lines are a difficulty in middle school physics learning because electric field lines are a notion of artificial abstraction and do not actually exist. Students have difficulty understanding in the teaching process, and teachers usually explain electric field lines by hand drawing electric field lines or electric field line pictures. However, hand-drawn electric field lines or pictures of electric field lines do not show well the dynamic changes of the electric field caused by e.g. charge changes (e.g. positional changes or newly added charges).
Disclosure of Invention
At least one embodiment of the present disclosure provides a method for generating a display image of electric field lines, including: receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises coordinates of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels; calculating values of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of stream function values, respectively.
For example, in at least one example of the generating method, values of a flow function of the at least one charge-formed electric field at positions corresponding to the plurality of image pixels are calculated, respectively, using a plurality of processing units included in a parallel processing array of a graphics processor.
For example, in at least one example of the generating method, a parameter of the at least one charge is received by a fragment shader; and causing the plurality of processing units to respectively invoke the fragment shader to calculate values of a flow function of the at least one charge-formed electric field at locations corresponding to the plurality of image pixels.
For example, in at least one example of the generating method, a flow function Φ_k (x, y) of an electric field formed by a kth charge of the at least one charge satisfies the following relationship:
Wherein the absolute value of n_k is equal to the number of electric field lines used to simulate and describe the electric field formed by the kth charge; (x_k, y_k) being the coordinates of the kth charge; (x, y) is used to represent the coordinates of any one of the plurality of image pixels, and k is a positive integer.
For example, in at least one example of the generating method, the charge amount of the at least one charge includes the charge amount of the kth charge; the generating method further comprises the following steps: the number of electric field lines simulating and describing the electric field formed by the kth charge is calculated based on the charge amount of the kth charge.
For example, in at least one example of the generating method, the at least one charge comprises a plurality of charges; and a value of a flow function of an electric field formed by the at least one charge at a location corresponding to each image pixel of the plurality of image pixels is equal to a sum of values of the flow function of the electric field formed by the plurality of charges at the location corresponding to each image pixel of the plurality of image pixels.
For example, in at least one example of the generating method, the setting the transparency of the plurality of image pixels based on the plurality of stream function values, respectively, includes: performing remainder taking operation on the plurality of stream function values relative to a preset constant respectively to obtain a plurality of remainders respectively; and setting transparency of the plurality of image pixels based on absolute values of the plurality of remainders, respectively.
For example, in at least one example of the generating method, the preset constant is 2π.
For example, in at least one example of the generating method, the setting the transparency of the plurality of image pixels based on the absolute values of the plurality of remainders, respectively, includes: performing normalization operations on absolute values of the plurality of remainders, respectively, to obtain a plurality of normalized values, respectively; performing line sharpening operations based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively; and setting transparency of the plurality of image pixels based on the plurality of sharpening values.
For example, in at least one example of the generating method, the transparency t_ij of the image pixel of the ith row and jth column of the plurality of image pixels and the sharpening value r_ij of the plurality of sharpening values corresponding to the image pixel of the ith row and jth column satisfy the following expression: t_ij=round (t×r_ij); t is the upper limit of the transparency of the plurality of image pixels of the display image, and round represents a rounding operation.
For example, in at least one example of the generating method, the performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, includes: performing a mapping operation on the plurality of normalized values to obtain a plurality of mapped values based on the plurality of normalized values, respectively; respectively calculating m powers of the mapping values, and respectively taking the m powers of the mapping values as the sharpening values, wherein m is a natural number larger than 8.
For example, in at least one example of the generating method, m is an integer greater than 10 and less than 30.
For example, in at least one example of the generating method, the performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, includes: respectively calculating the m powers of the normalized values, and taking the m powers of the normalized values as the sharpening values, wherein m is a natural number larger than 8.
For example, in at least one example of the generating method, the setting the transparency of the plurality of image pixels based on the absolute values of the plurality of remainders, respectively, includes: setting a transparency of an image pixel of the plurality of image pixels corresponding to a remainder of a first portion of the plurality of remainders to a first transparency, wherein a value of the first portion of the plurality of remainders is less than a predetermined threshold; and setting a transparency of an image pixel of the plurality of image pixels corresponding to a remainder of a second portion of the plurality of remainders to a second transparency, wherein a value of the second portion of the plurality of remainders is greater than or equal to the predetermined threshold, the second transparency being greater than the first transparency.
For example, in at least one example of the generating method, the first transparency means completely opaque and the second transparency means completely transparent.
For example, in at least one example of the generating method, the generating method further includes: the color values of the plurality of image pixels are set to the same value.
At least one embodiment of the present disclosure also provides a device for generating a display image of electric field lines, including: memory and a processor. The memory has stored therein computer program instructions adapted to be executed by the processor, which when executed by the processor cause the processor to perform the method of: receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises coordinates of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels; calculating values of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of stream function values, respectively.
For example, in at least one example of the generating means, the processor is a graphics processor.
At least one embodiment of the present disclosure also provides a storage medium storing computer program instructions that, when executed by a processor, cause a computer to perform a method comprising: receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises coordinates of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels; calculating values of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of stream function values, respectively.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below, and it is apparent that the drawings in the following description relate only to some embodiments of the present disclosure, not to limit the present disclosure.
FIG. 1 is an exemplary flow chart of a method of generating a display image of electric field lines provided by at least one embodiment of the present disclosure;
FIG. 2 is a schematic illustration of a displayed image of electric field lines obtained by employing the method described in the first example;
FIG. 3 is a schematic illustration of a displayed image of electric field lines obtained by employing the method described in the second example;
FIG. 4 is a schematic illustration of a displayed image of electric field lines obtained by employing the method described in the third example;
FIG. 5A is a schematic diagram illustrating one example of a correspondence of flow function values to normalized values in at least one embodiment of the present disclosure;
FIG. 5B illustrates a schematic diagram of one example of a correspondence of flow function values to map values in at least one embodiment of the present disclosure;
FIGS. 6-9 are four schematic diagrams of display images of electric field lines obtained by employing the method described in the fourth example;
FIG. 10 is a schematic block diagram of a display image generation apparatus of electric field lines provided by at least one embodiment of the present disclosure; and
Fig. 11 is a schematic block diagram of a storage medium as provided by at least one embodiment of the present disclosure.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present disclosure. It will be apparent that the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments, which can be made by one of ordinary skill in the art without the need for inventive faculty, are within the scope of the present disclosure, based on the described embodiments of the present disclosure.
Unless defined otherwise, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this disclosure belongs. The terms "first," "second," and the like, as used in this disclosure, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. Likewise, the word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", etc. are used merely to indicate relative positional relationships, which may also be changed when the absolute position of the object to be described is changed.
The inventors of the present disclosure have noted in research that using electric field line simulation techniques, a computing device may be used to generate a display image of (or map) electric field lines. However, the inventors of the present disclosure have also noted in research that the speed of displaying images of electric field lines generated based on the related electric field line simulation technique is slow (e.g., rendering efficiency is low, generating or rendering a displayed image of one frame of electric field lines for more than 10 seconds) or accuracy is poor. Accordingly, it is difficult to better demonstrate (e.g., real-time demonstrate) the dynamic effects of the electric field line variations based on these electric field line simulation techniques. The following is a detailed description in connection with an example.
For example, a fixed point iterative method may be used to generate an image of the electric field lines of the electrostatic field of point charges, in the following steps.
Step S501: the display range of the electric field lines of the electrostatic field of the point charges is set.
Step S502: some starting points are selected around the point charge as starting points of the electric field and starting points of the fixed point iteration.
Step S503: the direction of the combined field strength at the starting point is calculated using coulomb's law and a small displacement increment (e.g., a predetermined, fixed value step) is taken along the direction of the combined field strength, and the position (coordinates) of the first iteration point is obtained.
Step S504: calculating the direction of the combined field intensity at the first iteration point, and obtaining the position (coordinate) of the second iteration point based on the direction of the combined field intensity at the first iteration point.
The inventor of the present disclosure notes in the research that the method for generating the display image of the electric field lines by using the fixed-point iteration has the problems of large calculation amount, high performance requirement on the computing device and slower generation speed of the display image of the electric field lines; also, the above problem is more serious as the resolution of the display image of the electric field lines increases.
For example, since it takes a long time (for example, more than 10 seconds) to display the display image of the electric field lines of the electric field formed by the electric charges after the position change, it is necessary for students to wait for a certain period of time to see the display image of the electric field lines after the position change, that is, there is a problem of image sticking or the like; for example, in order to reduce adverse effects of problems such as image sticking and the like on the display effect, the display range of the electric field lines may be set to be relatively small, and in this case, the generated display image of the electric field lines is generally suitable for displaying on a small screen (for example, a mobile phone screen), but not well suitable for displaying in a class.
The inventors of the present disclosure have noted in research that methods of generating a displayed image of electric field lines using fixed-point iteration also suffer from relatively low accuracy. For example, for electrostatic charges, since the electric field is infinite at the location of the electrostatic charge (center of the electrostatic charge), the starting point of the iteration cannot select the center of the electrostatic charge, but only some points around the electrostatic charge can be selected as the starting point of the electric field lines; this will cause an error in the starting point of the fixed point iteration, and the position of the iteration point obtained by each iteration step has an error (compared with the exact position) caused by the starting point error, and thus causes the error in the position of the iteration point to gradually increase as the iteration proceeds; for another example, methods of generating a displayed image of electric field lines using fixed point iteration may also suffer from the problem of line interrogation and repeated line drawing where the electric field lines cannot be closed. For example, for the electric field lines of the electric field formed by the two different-numbered point charges, the electric field lines emitted from the positive charges may not be closed to the negative charges due to the above-described error, in which case the number of electric field lines around the negative charges is insufficient, and it is necessary to repair the electric field lines around the negative charges, which may cause a repeated line drawing problem. For example, the above-mentioned repeated line drawing problem is inconsistent with teaching content of "in electrostatic field, and the electric field lines start from positive charges to negative charges and terminate", so that the display image of the electric field lines generated based on the above-mentioned method is not suitable for application in teaching. The inventors of the present disclosure also noted in the study that the display image based on the electric field lines generated by other methods also has a problem that the accuracy of the display image of the electric field lines is low due to the corresponding reasons.
At least one embodiment of the present disclosure provides a method and apparatus for generating a display image of electric field lines, and a storage medium. The method for generating the display image of the electric field lines comprises the following steps: receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises a coordinate of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels; calculating values of a flow function of an electric field formed by at least one charge at positions corresponding to a plurality of image pixels based on parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and setting transparency of the plurality of image pixels based on the plurality of stream function values, respectively.
For example, by acquiring a plurality of flow function values respectively corresponding to a plurality of image pixels and setting the transparency of the plurality of image pixels based on the plurality of flow function values respectively corresponding to the plurality of image pixels, it is possible to generate a display image of electric field lines and make the method of generating a display image of electric field lines have the potential to increase the generation speed of the display image of electric field lines. In some examples, the method of generating the display image of the electric field lines may increase a generation speed (e.g., rendering efficiency) of the display image of the electric field lines, e.g., enable real-time rendering. In some examples, the method of generating a display image of the electric field lines may be used to generate a display image of the electric field lines formed by any number of charges located at any location (e.g., the locations of the centers of the plurality of charges are not collinear, i.e., not on the same virtual line). In some examples, the accuracy of the display image of the electric field lines obtained by the method for generating the display image of the electric field lines is higher. In some examples, the method for generating the display image of the electric field lines may consider both accuracy and rendering efficiency of the display image of the electric field lines.
The method for generating a display image of electric field lines provided according to at least one embodiment of the present disclosure is described in a non-limiting manner by several examples and embodiments, and as described below, different features of these specific examples and embodiments may be combined with each other without contradiction, thereby obtaining new examples and embodiments, which also fall within the scope of protection of the present disclosure.
Fig. 1 is an exemplary flowchart of a method of generating a display image of electric field lines provided by at least one embodiment of the present disclosure. As shown in fig. 1, the method for generating a display image of the electric field lines includes the following steps S110 to S130. For example, step S110, step S120, and step S130 may be sequentially performed.
Step S110: at least one parameter of the charge is received. The at least one parameter of the at least one charge includes a coordinate of the at least one charge and an amount of charge of the at least one charge, and the electric field lines simulate and describe a distribution of an electric field formed by the at least one charge, the display image including a plurality of image pixels.
Step S120: values of a flow function of an electric field formed by at least one charge at positions corresponding to a plurality of image pixels are calculated based on parameters of the at least one charge, and a plurality of flow function values corresponding to the plurality of image pixels, respectively, are acquired.
Step S130: transparency of the plurality of image pixels is set based on the plurality of stream function values, respectively.
For example, by setting the transparency of the plurality of image pixels by using the plurality of flow function values respectively corresponding to the plurality of image pixels, a display image of the electric field lines can be generated. For example, by generating a display image of electric field lines by adopting a method of setting the transparency of a plurality of image pixels based on a plurality of flow function values respectively corresponding to a plurality of image pixels, respectively, it is made possible to generate a display image of electric field lines using a graphic processor, thereby making the method of generating a display image of electric field lines have the potential of improving the generation speed of a display image of electric field lines.
For example, the method for generating a display image of electric field lines further includes: the color values of the plurality of image pixels are set to the same value, whereby the display effect of the display image of the electric field lines can be enhanced. For example, "setting the color values of a plurality of image pixels to the same value" means that the color values of the respective color channels representing the colors of the image pixels are all equal. For example, in the case where the colors of the image pixels are expressed using the RGB color space, the color values of the red channels, the color values of the green channels, and the color values of the blue channels may be made equal to each other for a plurality of image pixels. For example, the color values of the plurality of image pixels may be set to (0, 0), that is, the color value of the red channel, the color value of the green channel, and the color value of the blue channel are all zero.
For example, in step S110, the at least one charge may include one charge, two charges, or at least three charges. For example, where the at least one charge includes at least three charges, the locations of the at least three charges may be collinear or non-collinear. In some examples, the method of generating a display image of electric field lines may be used to generate a display image of any number of electric field lines formed by any number of charges located at any location, e.g., to support simulation of any number of electric field lines formed by any number of charges located at any location.
For example, in step S110, at least one parameter of the charge may be received from a graphical user interface. For example, in step S110, at least one parameter of the charge may be received by a shader (e.g., a fragment shader) that is running on the graphics processor.
For example, step S110 may further include: the resolution of the display image (or the number of pixels of a row and the number of pixels of a column of the display image) is received (e.g., received from a graphical user interface). For example, the number of pixels of a row and the number of pixels of a column of the display image may be pi_w and pi_h, respectively. For example, pi_w and pi_h may be 512 and 512, respectively. For another example, pi_w and pi_h may be 1920 and 1080, respectively, or other suitable values.
For example, the charge amount of the kth charge of the at least one charge is q_k, and k is a positive integer of 1 or more and 1 or less and equal to the number of the at least one charge. For example, the kth charge (e.g., the center of the charge) of the at least one charge has coordinates of (x_k, y_k). For example, the coordinates of the kth charge in the at least one charge may be coordinates of the kth charge in the display image (e.g., coordinates of the image pixel in which the kth charge is located). For example, the coordinates of the first and second of the at least one charge may be (128, 256) and (384, 256), respectively.
For example, in step S120, values of the flow function of the electric field formed by at least one electric charge at positions corresponding to the plurality of image pixels are respectively taken as a plurality of flow function values corresponding to the plurality of image pixels. For example, the coordinates of any one of the plurality of image pixels are (x, y). For example, x is a positive integer of 1 or more and pi_w or less, and y is a positive integer of 1 or more and pi_h or less. For another example, x is a non-negative positive integer greater than or equal to 0 and less than or equal to PI_W-1, and y is a non-negative positive integer greater than or equal to 0 and less than or equal to PI_H-1.
For example, in step S120, values of the flow function of the electric field formed by at least one charge at positions corresponding to a plurality of image pixels may be calculated (e.g., calculated in parallel), respectively, whereby not only errors due to the origin selection error and iteration (e.g., improving the accuracy of the electric field lines) may be avoided; the generation speed of the display image of the electric field lines can also be improved. For example, a plurality of stream function values corresponding to a plurality of image pixels, respectively, may be calculated in parallel using a plurality of processing units included in a parallel processing array such as a graphics processor. For example, the graphic processor has more processing units (e.g., arithmetic units) than the central processing unit (CPU, central Processing Unit), and thus the generation speed and rendering efficiency (e.g., real-time rendering) of the display image of the electric field lines can be further improved by parallel calculation of a plurality of stream function values respectively corresponding to a plurality of image pixels using a plurality of processing units included in a parallel processing array of the graphic processor, for example. For example, a display image of several tens of frames (e.g., 60 frames) of electric field lines may be generated per second.
For example, in step S120, the plurality of processing units are caused to respectively invoke shaders (e.g., fragment shaders) running on the graphics processor to calculate values of flow functions of at least one charge-formed electric field at locations corresponding to the plurality of image pixels. For example, a method of performing an operation using a plurality of processing units included in a graphics processor to respectively call shaders (e.g., fragment shaders) running on the graphics processor may refer to the related art, and will not be described herein.
For example, after the display image of the electric field lines is generated based on the generation method of the display image of the electric field lines, the display image of the electric field lines is supplied (for example, directly supplied) to a frame buffer (also referred to as a frame buffer or a video memory); each memory location of the frame buffer corresponds to a pixel on the display screen. For example, the entire frame buffer corresponds to one frame of the display image displayed on the display screen. For example, the frame buffer memory provides a display image of the electric field lines to a video image array (VGA) controller.
For example, in step S120, the flow function Φ_k (x, y) of the electric field formed by the kth charge of the at least one charge satisfies the following relationship:
Here, the absolute value of n_k is equal to the number of electric field lines used to simulate and describe the electric field formed by the kth charge.
For example, by making the flow function Φ_k of the electric field formed by the kth one of the at least one electric charges satisfy the above-described relational expression, it is possible to make the value of the flow function of the electric field formed by the at least one electric charge at the position corresponding to each of the plurality of image pixels equal to the sum of the values of the flow function of the electric field formed by the plurality of electric charges at the position corresponding to each of the plurality of image pixels in the case where the at least one electric charge includes the plurality of electric charges; for example, the flow function Φ (x, y) of the electric field formed at the location (x, y) of the three charges is equal to the sum of the flow function Φ_1 (x, y) of the electric field formed at the location (x, y) of the first charge, the flow function Φ_2 (x, y) of the electric field formed at the location (x, y) of the second charge and the flow function Φ_3 (x, y) of the electric field formed at the location (x, y), i.e., Φ (x, y) =Φ_1 (x, y) +Φ_2 (x, y) +Φ_3 (x, y); in this case, the method of generating a display image of electric field lines may be used to generate a display image of electric field lines formed of any number of electric charges located at any position (e.g., the positions of the centers of the plurality of electric charges are not collinear, i.e., not on the same virtual straight line), thereby allowing students to understand the characteristics of the electric field more deeply.
For example, step S120 may further include: the number of electric field lines (i.e., the absolute value of n_k) that simulate and describe the electric field formed by the kth charge is calculated based on the amount of charge of the kth charge. For example, the number of electric field lines of the electric field formed by the kth charge is positively correlated with the absolute value of the charge amount of the kth charge. For example, the specific relationship between the number of electric field lines of the electric field formed by the kth electric charge and the absolute value of the electric charge amount of the kth electric charge may be set according to practical application requirements, which is not described herein.
For example, step S120 further includes: the sign of n_k is determined based on the type (e.g., positive, negative) of the kth charge. For example, when the kth charge is positive, n_k is positive; where the kth charge is negative, n_k is negative.
For example, in step S130, the transparency of a plurality of image pixels is set based on a plurality of stream function values, respectively, including the following steps S131 and S132.
Step S131: and performing remainder operation on the plurality of stream function values relative to a preset constant respectively to obtain a plurality of remainders respectively. For example, in step S131, the preset constant is 2pi; in this case, the value of each of the plurality of remainders is equal to or greater than zero and less than 2pi.
Step S132: the transparency of the plurality of image pixels is set based on the absolute values of the plurality of remainders, respectively.
For example, in step S132, a specific method of setting the transparency of the plurality of image pixels based on the absolute values of the plurality of remainders, respectively, may be set according to actual application requirements, and will be exemplarily described below in connection with four examples.
In a first example, step S132 includes: the transparency of the image pixels of the plurality of image pixels corresponding to the remainder of the first portion of the plurality of remainders is set to a first transparency, and the transparency of the image pixels of the plurality of image pixels corresponding to the remainder of the second portion of the plurality of remainders is set to a second transparency, where the value of the first portion of the plurality of remainders is less than a predetermined threshold, the value of the second portion of the plurality of remainders is greater than or equal to the predetermined threshold, the second transparency being greater than the first transparency. For example, the first transparency may represent complete opacity and the second transparency may represent complete transparency.
For example, the predetermined threshold may be set according to actual application requirements. For example, the predetermined threshold is 0.8 or less (e.g., 0.4 or 0.2 or less). For example, by making the transparency (e.g., completely opaque) of an image pixel of the plurality of image pixels corresponding to a remainder of a first portion of the plurality of remainders less than the transparency (e.g., completely transparent) of an image pixel of the plurality of image pixels corresponding to a remainder of a second portion of the plurality of remainders, an image pixel of the plurality of image pixels corresponding to a flow function value substantially equal to 2 x t x pi (t being equal to a non-negative integer) may be found and electric field lines generated (e.g., drawn) based on the image pixels.
Fig. 2 is a schematic diagram of a display image of electric field lines (e.g., electric field lines for simulating and describing an electric field formed by two homonymous point charges) obtained by employing the method described in the first example. For example, the inventors of the present disclosure have noted in the study that, although image pixels corresponding to a flow function value substantially equal to 2×t×pi (t is equal to a non-negative integer) among a plurality of image pixels can be directly and simply found by the method of the first example, as shown in fig. 2, the display effect of the display image based on the electric field lines generated by the method may have a problem of appearing discontinuous, particularly, a portion of the electric field lines near the center of the point charges (see an area enclosed by a dotted frame of fig. 2).
The inventors of the present disclosure have noted in the study that it is possible to improve the display effect of the electric field lines at the positions near the point charges in the first example by setting the transparency of the plurality of image pixels based on the normalized values of the absolute values of the plurality of remainders, there may be a problem of appearing discontinuous and to enhance the display effect of the display image of the electric field lines. The following is an exemplary description in connection with the second to fourth examples.
For example, in the second example, step S132 includes the following steps S132a and s132b_1. For example, step S132a and step s21b_1 may be sequentially performed.
Step S132a: normalization operations are performed on the absolute values of the plurality of remainders, respectively, to obtain a plurality of normalized values, respectively.
For example, in step S132a, the ratios of the plurality of remainders to a preset constant (e.g., 2pi) may be respectively used as the plurality of normalization values; for example, the normalized values are 0 or more and 1 or less.
Step s132b_1: the rounded-up and rounded-down values of the product of the plurality of normalized values and the upper limit value T of the transparency of the plurality of image pixels of the display image (see a third example below for a specific description) are respectively taken as the transparency of the plurality of image pixels.
Fig. 3 is a schematic diagram of a display image of electric field lines (e.g., electric field lines for simulating and describing an electric field formed by two same-sign point charges) obtained by employing the method described in the second example. The inventors of the present disclosure have noted in the study that although there may be a problem that the display effect of the electric field lines at the positions near the point charges in the first example may appear discontinuous by rounding off the product of the plurality of normalized values and the upper limit value T of the transparency of the plurality of image pixels of the display image as the transparency of the plurality of image pixels, respectively, the display image of the electric field lines generated based on the method described in the second example may appear as a curved surface as shown in fig. 3, and therefore, it may not be easy for some students to correspond the display image of the electric field lines generated based on the method described in the second example to the electric field lines.
In the third and fourth examples, the line sharpening operation may be performed for the plurality of normalized values obtained based on step S132 to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, and the transparency of the plurality of image pixels may be set based on the plurality of sharpened values; in this case, the display effect of the display image of the electric field lines can be enhanced by causing the electric field lines in the display image of the electric field lines to appear in a curved form on the basis of improving the display effect of the electric field lines at a position near the point charges in the first example, which may be a problem of appearing discontinuous.
For example, in the third example, step S132 includes step S132a (see the second example for a detailed description), step S132b_2, and step S132c, and step S132a, step S132b_2, and step S132c may be sequentially performed, for example.
Step s132b_2: a line sharpening operation is performed based on the plurality of normalized values to a plurality of sharpened values.
Step S132c: the transparency of the plurality of image pixels is set based on the plurality of sharpening values.
For example, step S132b includes: respectively calculating the m powers of the normalized values, and taking the m powers of the normalized values as sharpening values, wherein m is a natural number larger than 8. For example, m is greater than 10 and less than 20 (e.g., is an integer greater than 10 and less than 20). For example, the inventors of the present disclosure have noted in the study that by making more than 10 and less than 20, the display effect of the display image of the electric field lines can be made better. For example, m is equal to 12, 16, 18, or other suitable values.
For example, in step S132c, the transparency t_ij of the image pixel of the ith row and jth column of the plurality of image pixels and the sharpening value r_ij of the plurality of sharpening values corresponding to the image pixel of the ith row and jth column satisfy the following expression: t_ij=round (t×r_ij); t is an upper limit value of transparency of a plurality of image pixels of the display image, and round represents a rounding operation. For example, the upper limit value of the transparency of the plurality of image pixels of the display image may be 255; in this case, the transparency of the plurality of image pixels is in the range of 0 to 255.
Fig. 4 is a schematic diagram of a display image of electric field lines (e.g., electric field lines for simulating and describing an electric field formed by two same-sign point charges) obtained by employing the method described in the third example. As shown in fig. 4, by causing the display of the electric field lines to perform a line sharpening operation based on a plurality of normalized values and setting the transparency of a plurality of image pixels based on a plurality of sharpened values, the electric field lines in the image can be caused to appear in a curved form, whereby the display effect of the display image of the electric field lines can be improved.
The inventors of the present disclosure have noted in investigation that in the display images of the electric field lines shown in fig. 3 and 4, the regions of highest transparency and the regions of lowest transparency are immediately adjacent (e.g., the regions immediately adjacent to being completely opaque) which have a certain adverse effect on the display effect of the display image of the electric field lines. The inventors of the present disclosure have also noted in the study that the above-described problem of the immediate vicinity of the region of highest transparency and the region of lowest transparency is mainly caused by the way the remainder operation is performed on the flow function and the transparency setting of the image pixels. An exemplary illustration is provided below in connection with fig. 5A.
FIG. 5A is a schematic diagram showing one example of the correspondence of the flow function value phi with the normalized value (the preset constant of the remainder operation is 2pi) in at least one embodiment of the present disclosure; for the second example, fig. 5A may also represent the flow function value versus transparency correspondence (without considering the rounding operation). For example, as shown in fig. 5A, the remainder operation is such that, where the flow function value corresponding to an image pixel is slightly less than 2×t×pi (t equals a non-negative integer), the transparency (normalized value) of the image pixel is at the highest region (e.g., substantially equal to 255, e.g., substantially completely transparent); whereas, in the case where the flow function value corresponding to the image pixel is equal to or slightly greater than 2×t×pi (t is equal to a non-negative integer), the transparency (normalized value) of the image pixel is in the lowest region (e.g., substantially equal to 0, e.g., substantially completely opaque).
The inventors of the present disclosure have also noted in the study that the problem of the immediate vicinity of the regions of highest transparency and the regions of lowest transparency can be avoided by performing a mapping operation (e.g., performing a mapping operation on normalized values), and thus adverse effects of the immediate vicinity of the regions of highest transparency and the regions of lowest transparency on the display effect of the display image of the electric field lines can be suppressed. The fourth example, fig. 5B, and fig. 6-9 are described below.
For example, in the fourth example, step S132 includes step S132a (see the second example for a detailed description), step s21b_3, step s21b_4, and step S132c (see the third example for a detailed description). For example, step S132a, step S132b_3, step S132b_4, and step S132c may be sequentially performed.
Step s132b_3: a mapping operation is performed on the plurality of normalized values to obtain a plurality of mapped values based on the plurality of normalized values, respectively.
For example, performing a mapping operation on a plurality of normalized values includes: mapping a lower limit value (e.g., 0) of the plurality of normalized values to a lower limit value (e.g., 0) of the plurality of normalized values; mapping an upper limit value (e.g., 1) of the plurality of normalized values to a lower limit value (e.g., 0) of the plurality of normalized values; and maps half (e.g., 0.5) of the sum of the upper and lower values of the plurality of normalized values to the upper value (e.g., 1) of the plurality of normalized values.
An exemplary illustration is provided below in connection with fig. 5B. Fig. 5B illustrates a schematic diagram of one example of a correspondence of flow function values to map values in at least one embodiment of the present disclosure. It should be noted that, for clarity and convenience of description, fig. 5B also shows the correspondence relationship between the flow function value Φ and the normalized value. For example, as shown in fig. 5B, 0 may be mapped to 0, 0.5 to 1, and 1 to 0.5.
Step s132b_4: respectively calculating m powers of the mapping values, and respectively taking the m powers of the mapping values as a plurality of sharpening values, wherein m is a natural number larger than 8.
For example, m is greater than 10 and less than 20 (e.g., is an integer greater than 10 and less than 20). For example, the inventors of the present disclosure have noted in the study that by making more than 10 and less than 20, the display effect of the display image of the electric field lines can be made better. For example, m is equal to 12, 16, 18, or other suitable values.
For example, as shown in fig. 5B, by performing a mapping operation (e.g., a mapping operation on a normalized value), and taking the m powers of a plurality of mapping values as a plurality of sharpening values, respectively, it is possible to reduce the adverse effect that the regions of highest transparency and the regions of lowest transparency bring about in close proximity to the display effect of the display image of the electric field lines, whereby the display effect of the display image of the electric field lines can be further improved. An exemplary description is provided below in connection with fig. 6-9.
Fig. 6 is a first schematic diagram of a display image of electric field lines obtained by employing the method described in the fourth example (e.g., electric field lines for simulating and describing an electric field formed by two homonymous point charges).
Fig. 7 is a second schematic diagram of a display image of electric field lines obtained by employing the method described in the fourth example (e.g., electric field lines for simulating and describing an electric field formed by two different-sign point charges). Fig. 8 is a third schematic diagram of a displayed image of electric field lines obtained by employing the method described in the fourth example (e.g., for simulating and describing electric field lines of an electric field formed by four non-collinear point charges). Fig. 9 is a fourth schematic diagram of a displayed image of electric field lines obtained by employing the method described in the fourth example (e.g., electric field lines for simulating and describing an electric field formed by one positive charge). For the sake of image and beauty, fig. 6 to 9 also show at least one point charge, at least one support for the point charge, at least one positive and negative information of the point charge, and the like.
For example, as shown in fig. 6-9, the display image of the electric field lines obtained by the method described in the fourth example can well simulate the generation of a display image of the electric field lines formed by any number of charges located at any position (for example, the positions of the centers of the plurality of charges are not collinear, that is, not on the same virtual straight line), thereby allowing the student to understand the characteristics of the electric field more deeply. In addition, as described above, in some examples, the method for generating a display image of an electric field line may use a plurality of processing units included in a parallel processing array of a graphics processor to calculate a plurality of stream function values corresponding to a plurality of image pixels in parallel, so that the generation speed and the rendering efficiency (e.g., real-time rendering) of the display image of the electric field line may be further improved, and both the accuracy and the rendering efficiency of the display image of the electric field line may be considered.
At least one embodiment of the present disclosure further provides a device for generating a display image of electric field lines. Fig. 10 is a schematic block diagram of a display image generating apparatus of electric field lines provided by at least one embodiment of the present disclosure.
As shown in fig. 10, the apparatus for generating a display image of electric field lines includes: memory and a processor. Stored in the memory are computer program instructions adapted to be executed by the processor, which when executed by the processor cause the processor to perform the method of: receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises a coordinate of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels; calculating values of a flow function of an electric field formed by at least one charge at positions corresponding to a plurality of image pixels based on parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; transparency of the plurality of image pixels is set based on the plurality of stream function values, respectively.
For example, by acquiring a plurality of flow function values respectively corresponding to a plurality of image pixels and setting the transparency of the plurality of image pixels based on the plurality of flow function values respectively corresponding to the plurality of image pixels, it is possible to generate a display image of electric field lines and make the generation device of the display image of electric field lines have the potential to increase the generation speed of the display image of electric field lines.
For example, at least one embodiment of the present disclosure further provides a related method related to a generating device of a display image of an electric field line, which may refer to a related description of a generating method of a display image of an electric field line, and will not be described herein.
For example, the processor may be a Graphics Processor (GPU), in which case a plurality of flow function values corresponding to a plurality of image pixels may be calculated in parallel using a plurality of processing units included in a parallel processing array of the graphics processor, for example, and a generation speed of a display image of the electric field lines may be further increased (for example, the display image of the electric field lines may be generated in real time).
The means for generating a display image of the electric field lines further comprise a graphical user interface, for example. For example, the generation means of the display image of the electric field lines allows real-time response to an operation of a user (e.g., a teacher) using a graphical user interface. For example, in response to a user dragging an electric charge resulting in a change in the position of the electric charge, a display image of new electric field lines is generated and provided to a graphical user interface for display.
For example, a user may select a kth charge (k is a positive integer greater than or equal to 1 and less than or equal to the number of at least one charge) of at least one charge in a graphical user interface, and change a position of the kth charge by dragging, the position of the updated charge being transferred to a shader (e.g., a fragment shader) operating on a graphics processor via the graphical user interface, the shader calculating a value of a flow function of an electric field formed by the at least one charge at a position corresponding to a plurality of image pixels based on the position of the updated charge, and setting transparency of the plurality of image pixels based on the plurality of flow function values, respectively, whereby a display image of electric field lines of the electric field formed by the at least one charge after the position change may be obtained.
For example, the device for generating a display image of electric field lines provided by at least one embodiment of the present disclosure may render a display image of electric field lines of several tens frames (for example, 60 frames) per second, thereby allowing a teacher to drag at least one charge in a graphical user interface and generate a display image of electric field lines of an electric field formed by the at least one charge with a changed position, so that the device for generating a display image of electric field lines provided by at least one embodiment of the present disclosure may better demonstrate the effect of real-time dynamics of electric field line changes, and further, a teacher may better explain the relevant knowledge of electric field lines, and a student may also more easily understand the relevant knowledge of electric field lines, thereby enhancing learning interest of the relevant knowledge of electric field lines.
It should be noted that, regardless of the generation speed of the display image of the electric field lines, a Central Processing Unit (CPU), a Tensor Processor (TPU), or other forms of processing units having data processing capability and/or instruction execution capability may also be employed as the processor. For example, the processor may be implemented as a general purpose processor, and may also be a single chip microcomputer, a microprocessor, a digital signal processor, a dedicated image processing chip, a field programmable logic array, or the like.
For example, the memory may include at least one of volatile memory and nonvolatile memory, e.g., the memory may include Read Only Memory (ROM), hard disk, flash memory, etc. Accordingly, the memory may be implemented as one or more computer program products, which may include various forms of computer-readable storage media, on which one or more computer program instructions may be stored. The processor may execute the program instructions to perform a method for generating a display image of any one of the electric field lines provided by at least one embodiment of the present disclosure. The memory may also store various other applications and various data, such as various data used and/or generated by the applications.
At least one embodiment of the present disclosure also provides a storage medium (e.g., a non-transitory storage medium). Fig. 11 is a schematic block diagram of a storage medium as provided by at least one embodiment of the present disclosure.
As shown in fig. 11, the storage medium stores computer program instructions that, when executed by a processor, cause the computer to perform a method comprising: receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises a coordinate of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels; calculating values of a flow function of an electric field formed by at least one charge at positions corresponding to a plurality of image pixels based on parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; transparency of the plurality of image pixels is set based on the plurality of stream function values, respectively.
For example, computer program instructions in the storage medium, when executed by a processor, may generate a display image of electric field lines and have the potential to increase the speed of generation of the display image of electric field lines. For example, the related method related to the storage medium may refer to the related description of the method for generating the display image of the electric field line, which is not described herein.
For example, the storage medium may take many forms, including tangible storage medium, carrier wave media, or physical transmission media. The stable storage medium may include: optical or magnetic disks, and other computers or similar devices, can implement the storage system of the system components depicted in the figures. The unstable storage media may include dynamic memory, such as the main memory of a computer platform, and the like. Tangible transmission media may include coaxial cables, copper wire and fiber optics, such as the wires that form a bus within a computer system. Carrier wave transmission media can convey electrical, electromagnetic, acoustic or optical signals, etc. These signals may be generated by means of radio frequency or infrared data communication. Typical storage media (e.g., computer readable media) include hard disks, floppy disks, magnetic tape, any other magnetic media; CD-ROM, DVD, DVD-ROM, any other optical medium; punch cards, any other physical storage medium containing a small pore pattern; RAM, PROM, EPROM, FLASH-EPROM, any other memory chip or tape; a carrier wave transporting the data or instructions, a cable or connection means transporting the carrier wave, any other data that may be read using computer program instructions (e.g., program code) and/or a computer.
Computer program instructions (e.g., program code) for performing the operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
While the disclosure has been described in detail with respect to the general description and the specific embodiments thereof, it will be apparent to those skilled in the art that certain modifications and improvements may be made thereto based on the embodiments of the disclosure. Accordingly, such modifications or improvements may be made without departing from the spirit of the disclosure and are intended to be within the scope of the disclosure as claimed.
The foregoing is merely exemplary embodiments of the present disclosure and is not intended to limit the scope of the disclosure, which is defined by the appended claims.

Claims (18)

1. A method of generating a display image of electric field lines, comprising:
Receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises coordinates of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels;
Calculating values of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and
Respectively setting transparency of the plurality of image pixels based on the plurality of stream function values;
wherein a flow function phi_k (x, y) of an electric field formed by a kth charge of the at least one charge satisfies the following relationship:
Wherein the absolute value of n_k is equal to the number of electric field lines used to simulate and describe the electric field formed by the kth charge; (x_k, y_k) being the coordinates of the kth charge; (x, y) is used to represent the coordinates of any one of the plurality of image pixels, and k is a positive integer.
2. The generating method according to claim 1, wherein values of the flow functions of the electric field formed by the at least one electric charge at positions corresponding to the plurality of image pixels are calculated respectively using a plurality of processing units included in a parallel processing array of the graphic processor.
3. The generation method of claim 2, wherein the parameter of the at least one charge is received by a fragment shader; and
Causing the plurality of processing units to respectively invoke the fragment shader to calculate values of a flow function of the at least one charge-formed electric field at locations corresponding to the plurality of image pixels.
4. The generation method according to claim 1, wherein the charge amount of the at least one charge includes the charge amount of the kth charge; and
The generating method further comprises the following steps: the number of electric field lines simulating and describing the electric field formed by the kth charge is calculated based on the charge amount of the kth charge.
5. The generation method of claim 1, wherein the at least one charge comprises a plurality of charges; and
The value of the flow function of the electric field formed by the at least one charge at the location corresponding to each of the plurality of image pixels is equal to the sum of the values of the flow function of the electric field formed by the plurality of charges at the location corresponding to each of the plurality of image pixels.
6. The generating method according to any one of claims 1 to 5, wherein the setting the transparency of the plurality of image pixels based on the plurality of stream function values, respectively, includes:
Performing remainder taking operation on the plurality of stream function values relative to a preset constant respectively to obtain a plurality of remainders respectively; and
Transparency of the plurality of image pixels is set based on absolute values of the plurality of remainders, respectively.
7. The generating method according to claim 6, wherein the preset constant is 2Ω.
8. The generation method according to claim 6, wherein the setting the transparency of the plurality of image pixels based on the absolute values of the plurality of remainders, respectively, comprises:
Performing normalization operations on absolute values of the plurality of remainders, respectively, to obtain a plurality of normalized values, respectively;
Performing line sharpening operations based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively; and
Transparency of the plurality of image pixels is set based on the plurality of sharpening values.
9. The generating method according to claim 8, wherein a transparency t_ij of an image pixel of an ith row and a jth column of the plurality of image pixels and a sharpening value r_ij of the plurality of sharpening values corresponding to the ith row and the jth column satisfy the following expression:
t_ij=round(T×r_ij);
T is the upper limit of the transparency of the plurality of image pixels of the display image, and round represents a rounding operation.
10. The generating method according to claim 8, wherein the performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, comprises:
performing a mapping operation on the plurality of normalized values to obtain a plurality of mapped values based on the plurality of normalized values, respectively; and
Respectively calculating m powers of the mapping values, and respectively taking the m powers of the mapping values as the sharpening values, wherein m is a natural number larger than 8.
11. The generation method according to claim 10, wherein m is an integer greater than 10 and less than 30.
12. The generating method according to claim 8, wherein the performing a line sharpening operation based on the plurality of normalized values to obtain a plurality of sharpened values based on the plurality of normalized values, respectively, comprises:
respectively calculating the m powers of the normalized values, and taking the m powers of the normalized values as the sharpening values, wherein m is a natural number larger than 8.
13. The generation method according to claim 6, wherein the setting the transparency of the plurality of image pixels based on the absolute values of the plurality of remainders, respectively, comprises:
Setting a transparency of an image pixel of the plurality of image pixels corresponding to a remainder of a first portion of the plurality of remainders to a first transparency, wherein a value of the first portion of the plurality of remainders is less than a predetermined threshold; and
And setting the transparency of the image pixels corresponding to the remainder of the second part of the plurality of remainders to be a second transparency, wherein the value of the remainder of the second part of the plurality of remainders is greater than or equal to the preset threshold value, and the second transparency is greater than the first transparency.
14. The method of generating of claim 13, wherein the first transparency indicates complete opacity and the second transparency indicates complete transparency.
15. The generation method according to any one of claims 1 to 5, further comprising: the color values of the plurality of image pixels are set to the same value.
16. A device for generating a display image of electric field lines, comprising: a memory and a processor, wherein the memory is configured to store,
Wherein the memory has stored therein computer program instructions adapted to be executed by the processor, which when executed by the processor cause the processor to perform the method of:
Receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises coordinates of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels;
Calculating values of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and
Respectively setting transparency of the plurality of image pixels based on the plurality of stream function values;
wherein a flow function phi_k (x, y) of an electric field formed by a kth charge of the at least one charge satisfies the following relationship:
Wherein the absolute value of n_k is equal to the number of electric field lines used to simulate and describe the electric field formed by the kth charge; (x_k, y_k) being the coordinates of the kth charge; (x, y) is used to represent the coordinates of any one of the plurality of image pixels, and k is a positive integer.
17. The generating device of claim 16, wherein the processor is a graphics processor.
18. A storage medium storing computer program instructions that, when executed by a processor, cause a computer to perform a method comprising:
Receiving at least one parameter of the electrical charge, wherein the at least one parameter of the electrical charge comprises coordinates of the at least one electrical charge and an amount of charge of the at least one electrical charge, the electric field lines simulating and describing a distribution of an electric field formed by the at least one electrical charge, the display image comprising a plurality of image pixels;
Calculating values of a flow function of an electric field formed by the at least one charge at positions corresponding to the plurality of image pixels based on the parameters of the at least one charge, and acquiring a plurality of flow function values respectively corresponding to the plurality of image pixels; and
Respectively setting transparency of the plurality of image pixels based on the plurality of stream function values;
wherein a flow function phi_k (x, y) of an electric field formed by a kth charge of the at least one charge satisfies the following relationship:
Wherein the absolute value of n_k is equal to the number of electric field lines used to simulate and describe the electric field formed by the kth charge; (x_k, y_k) being the coordinates of the kth charge; (x, y) is used to represent the coordinates of any one of the plurality of image pixels, and k is a positive integer.
CN202011548510.4A 2020-12-24 Method and device for generating display image of electric field lines and storage medium Active CN112580213B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011548510.4A CN112580213B (en) 2020-12-24 Method and device for generating display image of electric field lines and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011548510.4A CN112580213B (en) 2020-12-24 Method and device for generating display image of electric field lines and storage medium

Publications (2)

Publication Number Publication Date
CN112580213A CN112580213A (en) 2021-03-30
CN112580213B true CN112580213B (en) 2024-07-05

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102663723A (en) * 2012-02-24 2012-09-12 武汉大学 Image segmentation method based on color sample and electric field model
CN103984876A (en) * 2014-06-11 2014-08-13 国家电网公司 Calculation method for synthetic electric field of ultrahigh voltage direct-current transmission line crossing complex terrain

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102663723A (en) * 2012-02-24 2012-09-12 武汉大学 Image segmentation method based on color sample and electric field model
CN103984876A (en) * 2014-06-11 2014-08-13 国家电网公司 Calculation method for synthetic electric field of ultrahigh voltage direct-current transmission line crossing complex terrain

Similar Documents

Publication Publication Date Title
EP4120199A1 (en) Image rendering method and apparatus, and electronic device and storage medium
US9275493B2 (en) Rendering vector maps in a geographic information system
KR102465969B1 (en) Apparatus and method for performing graphics pipeline
Theoharis et al. Graphics and visualization: principles & algorithms
CN109448137B (en) Interaction method, interaction device, electronic equipment and storage medium
US10540789B2 (en) Line stylization through graphics processor unit (GPU) textures
CN110069191B (en) Terminal-based image dragging deformation implementation method and device
CN110689598B (en) Three-dimensional modeling method and system for multilayer road
CN116934769A (en) Interactive segmentation model training method, annotation data generation method and equipment
CN116310036A (en) Scene rendering method, device, equipment, computer readable storage medium and product
CN114375464A (en) Ray tracing dynamic cells in virtual space using bounding volume representations
CN114820972A (en) Contour line and/or contour surface generation method, system, device and storage medium
JPH03202981A (en) Three-dimensional graphic dis- play method and system
CN111569418B (en) Rendering method, device and medium for content to be output and electronic equipment
CN117611703A (en) Barrage character rendering method, barrage character rendering device, barrage character rendering equipment, storage medium and program product
CN112580213B (en) Method and device for generating display image of electric field lines and storage medium
CN110069195B (en) Image dragging deformation method and device
CN112528707A (en) Image processing method, device, equipment and storage medium
CN112132859A (en) Sticker generation method, apparatus, medium, and electronic device
CN114219884A (en) Particle special effect rendering method, device and equipment and storage medium
CN112580213A (en) Method and apparatus for generating display image of electric field lines, and storage medium
US20130106887A1 (en) Texture generation using a transformation matrix
WO2023005104A1 (en) Multi-view display method and apparatus, and device and medium
KR100848687B1 (en) 3-dimension graphic processing apparatus and operating method thereof
CN114764841A (en) Use of built-in functions for shadow denoising in ray tracing applications

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant